public class JZlibDecoder extends ZlibDecoder
ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Constructor and Description |
---|
JZlibDecoder()
用默认包装器创建一个新实例(
ZlibWrapper.ZLIB )。
|
JZlibDecoder(byte[] dictionary)
用指定的预设字典创建一个新实例。
|
JZlibDecoder(ZlibWrapper wrapper)
用指定的包装器创建一个新的实例。
|
Modifier and Type | Method and Description |
---|---|
protected void |
decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out)
解码从一个 ByteBuf 到另一个。
|
boolean |
isClosed()
返回
true 当且仅当已达到压缩流的结尾。
|
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 JZlibDecoder()
ZlibWrapper.ZLIB
)。
DecompressionException
- 如果初始化zlib失败
public JZlibDecoder(ZlibWrapper wrapper)
DecompressionException
- 如果初始化zlib失败
public JZlibDecoder(byte[] dictionary)
ZlibWrapper.ZLIB
,因为它是唯一支持预设字典的格式。
DecompressionException
- 如果初始化zlib失败
public boolean isClosed()
true
当且仅当已达到压缩流的结尾。
isClosed
在课堂上
ZlibDecoder
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.