public abstract class ZlibDecoder extends ByteToMessageDecoder
ByteBuf
using the deflate algorithm.ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable
Modifier and Type | Field and Description |
---|---|
protected int |
maxAllocation
Maximum allowed size of the decompression buffer.
|
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Constructor and Description |
---|
ZlibDecoder()
Same as
ZlibDecoder(int) with maxAllocation = 0. |
ZlibDecoder(int maxAllocation)
Construct a new ZlibDecoder.
|
Modifier and Type | Method and Description |
---|---|
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.Copyright © 2008–2024 The Netty Project. All rights reserved.