public abstract class ZlibDecoder extends ByteToMessageDecoder
ByteBuf
using the deflate algorithm.ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable
限定符和类型 | 字段和说明 |
---|---|
protected int |
maxAllocation
Maximum allowed size of the decompression buffer.
|
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
构造器和说明 |
---|
ZlibDecoder()
Same as
ZlibDecoder(int) with maxAllocation = 0. |
ZlibDecoder(int maxAllocation)
Construct a new ZlibDecoder.
|
限定符和类型 | 方法和说明 |
---|---|
protected void |
decompressionBufferExhausted(ByteBuf buffer)
Called when the decompression buffer cannot be expanded further.
|
abstract boolean |
isClosed()
Returns
true if and only if the end of the compressed stream
has been reached. |
protected ByteBuf |
prepareDecompressBuffer(ChannelHandlerContext ctx,
ByteBuf buffer,
int preferredSize)
Allocate or expand the decompression buffer, without exceeding the maximum allocation.
|
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decode, 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
protected final int maxAllocation
public ZlibDecoder()
ZlibDecoder(int)
with maxAllocation = 0.public ZlibDecoder(int maxAllocation)
maxAllocation
- Maximum size of the decompression buffer. Must be >= 0.
If zero, maximum size is decided by the ByteBufAllocator
.public abstract boolean isClosed()
true
if and only if the end of the compressed stream
has been reached.protected ByteBuf prepareDecompressBuffer(ChannelHandlerContext ctx, ByteBuf buffer, int preferredSize)
decompressionBufferExhausted(ByteBuf)
if the buffer is full and cannot be expanded further.protected void decompressionBufferExhausted(ByteBuf buffer)
DecompressionException
is thrown, such as log the
data that was decompressed so far.