public class StompSubframeDecoder extends ReplayingDecoder<io.netty.handler.codec.stomp.StompSubframeDecoder.State>
ByteBuf s解码为StompHeadersSubframe s和StompContentSubframe s。
maxLineLength的最大长度 - 限制命令行和标题行的长度如果初始行的长度超过此值,则会引发TooLongFrameException 。
maxChunkSize内容或每个块的最大长度。
如果内容长度(或每个块的长度)超过此值,则内容或块将被拆分为最大长度为maxChunkSize多个StompContentSubframe 。
maxChunkSize ,则HTTP消息的传输编码为“分块”,此解码器会生成多个StompContentSubframe实例以避免过多的内存消耗。
请注意,即使没有内容,每条消息最后都会解码LastStompContentSubframe以简化上游消息解析。
ByteToMessageDecoder.CumulatorChannelHandler.SharableCOMPOSITE_CUMULATOR, MERGE_CUMULATOR| Constructor and Description |
|---|
StompSubframeDecoder() |
StompSubframeDecoder(boolean validateHeaders) |
StompSubframeDecoder(int maxLineLength, int maxChunkSize) |
StompSubframeDecoder(int maxLineLength, int maxChunkSize, boolean validateHeaders) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out)
解码从一个 ByteBuf到另一个。
|
callDecode, checkpoint, checkpoint, state, stateactualReadableBytes, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtensureNotSharable, handlerAdded, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlerAddedpublic StompSubframeDecoder()
public StompSubframeDecoder(boolean validateHeaders)
public StompSubframeDecoder(int maxLineLength,
int maxChunkSize) public StompSubframeDecoder(int maxLineLength,
int maxChunkSize,
boolean validateHeaders) protected void decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws java.lang.Exception
ByteToMessageDecoder
decode在课程
ByteToMessageDecoder
ctx - 这ByteToMessageDecoder所属的ChannelHandlerContext
in - 从中读取数据的ByteBuf
out - 应该添加解码消息的
List
java.lang.Exception - 发生错误时抛出
Copyright © 2008–2018 The Netty Project. All rights reserved.