@UnstableApi public final class SmtpResponseDecoder extends LineBasedFrameDecoder
ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.CharSequence> |
details |
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Constructor and Description |
---|
SmtpResponseDecoder(int maxLineLength)
Creates a new instance that enforces the given
maxLineLength . |
Modifier and Type | Method and Description |
---|---|
protected SmtpResponse |
decode(ChannelHandlerContext ctx,
ByteBuf buffer)
Create a frame out of the
ByteBuf and return it. |
private static DecoderException |
newDecoderException(ByteBuf buffer,
int readerIndex,
int readable) |
private static int |
parseCode(ByteBuf buffer)
Parses the io.netty.handler.codec.smtp code without any allocation, which is three digits.
|
private static int |
parseNumber(byte b) |
decode
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 SmtpResponseDecoder(int maxLineLength)
maxLineLength
.protected SmtpResponse decode(ChannelHandlerContext ctx, ByteBuf buffer) throws java.lang.Exception
LineBasedFrameDecoder
ByteBuf
and return it.decode
in class LineBasedFrameDecoder
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.java.lang.Exception
private static DecoderException newDecoderException(ByteBuf buffer, int readerIndex, int readable)
private static int parseCode(ByteBuf buffer)
private static int parseNumber(byte b)