public final class TcpDnsResponseDecoder extends LengthFieldBasedFrameDecoder
ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Constructor and Description |
---|
TcpDnsResponseDecoder()
Creates a new decoder with the default record decoder.
|
TcpDnsResponseDecoder(DnsRecordDecoder recordDecoder,
int maxFrameLength)
Creates a new decoder with the specified
recordDecoder and maxFrameLength |
Modifier and Type | Method and Description |
---|---|
protected Object |
decode(ChannelHandlerContext ctx,
ByteBuf in)
Create a frame out of the
ByteBuf and return it. |
protected ByteBuf |
extractFrame(ChannelHandlerContext ctx,
ByteBuf buffer,
int index,
int length)
Extract the sub-region of the specified buffer.
|
decode, getUnadjustedFrameLength
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
ensureNotSharable, handlerAdded, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded
public TcpDnsResponseDecoder()
public TcpDnsResponseDecoder(DnsRecordDecoder recordDecoder, int maxFrameLength)
recordDecoder
and maxFrameLength
protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception
LengthFieldBasedFrameDecoder
ByteBuf
and return it.decode
in class LengthFieldBasedFrameDecoder
ctx
- the ChannelHandlerContext
which this ByteToMessageDecoder
belongs toin
- the ByteBuf
from which to read dataByteBuf
which represent the frame or null
if no frame could
be created.Exception
protected ByteBuf extractFrame(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length)
LengthFieldBasedFrameDecoder
extractFrame
in class LengthFieldBasedFrameDecoder
Copyright © 2008–2024 The Netty Project. All rights reserved.