Top Fields Constructors Methods
io.netty.handler.codec.dns

public final Class TcpDnsQueryEncoder

extends MessageToByteEncoder<DnsQuery>
Class Inheritance
Annotations
@Sharable
@UnstableApi
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelHandler, .ChannelHandlerContext, io.netty.handler.codec.MessageToByteEncoder, io.netty.util.internal.UnstableApi

Field Summary

Modifier and TypeField and Description
private final DnsQueryEncoder

Constructor Summary

AccessConstructor and Description
public
TcpDnsQueryEncoder()

Creates a new encoder with the default record encoder.

public
TcpDnsQueryEncoder(DnsRecordEncoder recordEncoder)

Creates a new encoder with the specified recordEncoder.

Method Summary

Modifier and TypeMethod and Description
protected ByteBuf
protected void
encode(ChannelHandlerContext ctx, DnsQuery
the message to encode
msg
,
ByteBuf
the ByteBuf into which the encoded message will be written
out
)

Implements abstract io.netty.handler.codec.MessageToByteEncoder.encode.

Encode a message into a ByteBuf.
Inherited from io.netty.handler.codec.MessageToByteEncoder:
acceptOutboundMessageisPreferDirectwrite

Field Detail

encoderback to summary
private final DnsQueryEncoder encoder

Constructor Detail

TcpDnsQueryEncoderback to summary
public TcpDnsQueryEncoder()

Creates a new encoder with the default record encoder.

TcpDnsQueryEncoderback to summary
public TcpDnsQueryEncoder(DnsRecordEncoder recordEncoder)

Creates a new encoder with the specified recordEncoder.

Method Detail

allocateBufferback to summary
protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, DnsQuery msg, boolean preferDirect)

Overrides io.netty.handler.codec.MessageToByteEncoder.allocateBuffer.

Doc from io.netty.handler.codec.MessageToByteEncoder.allocateBuffer.

Allocate a ByteBuf which will be used as argument of encode(ChannelHandlerContext, I, ByteBuf). Sub-classes may override this method to return ByteBuf with a perfect matching initialCapacity.

Annotations
@Override
encodeback to summary
protected void encode(ChannelHandlerContext ctx, DnsQuery msg, ByteBuf out) throws Exception

Implements abstract io.netty.handler.codec.MessageToByteEncoder.encode.

Doc from io.netty.handler.codec.MessageToByteEncoder.encode.

Encode a message into a ByteBuf. This method will be called for each written message that can be handled by this encoder.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this MessageToByteEncoder belongs to

msg:DnsQuery

the message to encode

out:ByteBuf

the ByteBuf into which the encoded message will be written

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs