public class LenientLineBasedFrameDecoder
extends io.netty.handler.codec.ByteToMessageDecoder
ByteBufs on line endings.
Both "\n" and "\r\n" are handled.
For a more general delimiter-based decoder, see DelimiterBasedFrameDecoder.
| Constructor and Description |
|---|
LenientLineBasedFrameDecoder(int maxLength)
Creates a new decoder.
|
LenientLineBasedFrameDecoder(int maxLength,
boolean stripDelimiter,
boolean failFast,
boolean emitLastLineWithoutDelimiter)
Creates a new decoder.
|
| Modifier and Type | Method and Description |
|---|---|
protected Object |
decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf buffer)
Create a frame out of the
ByteBuf and return it. |
protected void |
decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
List<Object> out) |
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtensureNotSharable, handlerAdded, isSharablepublic LenientLineBasedFrameDecoder(int maxLength)
maxLength - the maximum length of the decoded frame.
A TooLongFrameException is thrown if
the length of the frame exceeds this value.public LenientLineBasedFrameDecoder(int maxLength,
boolean stripDelimiter,
boolean failFast,
boolean emitLastLineWithoutDelimiter)
maxLength - the maximum length of the decoded frame.
A TooLongFrameException is thrown if
the length of the frame exceeds this value.stripDelimiter - whether the decoded frame should strip out the
delimiter or notfailFast - If true, a TooLongFrameException is
thrown as soon as the decoder notices the length of the
frame will exceed maxFrameLength regardless of
whether the entire frame has been read.
If false, a TooLongFrameException is
thrown after the entire frame that exceeds
maxFrameLength has been read.emitLastLineWithoutDelimiter - emit the last line even if it doesn't
end with the delimiterprotected final void decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
List<Object> out)
throws Exception
decode in class io.netty.handler.codec.ByteToMessageDecoderExceptionprotected Object decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf buffer) throws Exception
ByteBuf and return it.ctx - the ChannelHandlerContext which this ByteToMessageDecoder belongs tobuffer - the ByteBuf from which to read dataByteBuf which represent the frame or null if no frame could
be created.ExceptionCopyright © 2012–2021 Graylog, Inc.. All rights reserved.