@UnstableApi public final class RedisDecoder extends ByteToMessageDecoder
RedisMessage
个对象。
RedisMessage
个部分可以被聚合以RedisMessage
使用RedisArrayAggregator
或直接加工。
ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Constructor and Description |
---|
RedisDecoder()
使用默认值
maxInlineMessageLength 和
messagePool 创建一个新实例。
|
RedisDecoder(int maxInlineMessageLength, RedisMessagePool messagePool)
创建一个新的实例。
|
Modifier and Type | Method and Description |
---|---|
protected void |
decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out)
解码从一个 ByteBuf 到另一个。
|
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 RedisDecoder()
maxInlineMessageLength
和
messagePool
创建一个新实例。
public RedisDecoder(int maxInlineMessageLength, RedisMessagePool messagePool)
maxInlineMessageLength
- 内联消息的最大长度。
messagePool
- 预定义的消息池。
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.