@ChannelHandler.Sharable public class DatagramDnsResponseEncoder extends io.netty.handler.codec.MessageToMessageEncoder<io.netty.channel.AddressedEnvelope<DnsResponse,InetSocketAddress>>
| Constructor and Description |
|---|
DatagramDnsResponseEncoder()
Creates a new encoder with the default record encoder.
|
DatagramDnsResponseEncoder(DnsRecordEncoder recordEncoder)
Creates a new encoder with the specified
recordEncoder. |
| Modifier and Type | Method and Description |
|---|---|
protected io.netty.buffer.ByteBuf |
allocateBuffer(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.AddressedEnvelope<DnsResponse,InetSocketAddress> msg)
Allocate a
ByteBuf which will be used for constructing a datagram packet. |
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.AddressedEnvelope<DnsResponse,InetSocketAddress> in,
List<Object> out) |
acceptOutboundMessage, writebind, close, connect, deregister, disconnect, flush, readensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharablepublic DatagramDnsResponseEncoder()
public DatagramDnsResponseEncoder(DnsRecordEncoder recordEncoder)
recordEncoder.protected void encode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.AddressedEnvelope<DnsResponse,InetSocketAddress> in,
List<Object> out)
throws Exception
encode in class io.netty.handler.codec.MessageToMessageEncoder<io.netty.channel.AddressedEnvelope<DnsResponse,InetSocketAddress>>Exceptionprotected io.netty.buffer.ByteBuf allocateBuffer(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.AddressedEnvelope<DnsResponse,InetSocketAddress> msg)
throws Exception
ByteBuf which will be used for constructing a datagram packet.
Sub-classes may override this method to return a ByteBuf with a perfect matching initial capacity.ExceptionCopyright © 2008–2025 The Netty Project. All rights reserved.