Package org.drasyl.handler.codec
Class MaxLengthFrameDecoder
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.ByteToMessageDecoder
-
- org.drasyl.handler.codec.MaxLengthFrameDecoder
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public class MaxLengthFrameDecoder extends io.netty.handler.codec.ByteToMessageDecoder
A decoder that splits receivedByteBuf
s into frames not larger thenmaxFrameLength
. For example, if you received the following four fragmented packets:+---+----+-----+----+ | A | BC | DEF | GH | +---+----+-----+----+
AMaxLengthFrameDecoder
(2)
will decode them into the following three packets with the fixed length:+---+----+----+---+----+ | A | BC | DE | F | GH | +---+----+----+---+----+
-
-
Constructor Summary
Constructors Constructor Description MaxLengthFrameDecoder(int maxFrameLength)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, List<Object> out)
-
Methods inherited from class io.netty.handler.codec.ByteToMessageDecoder
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharable
-
-