public abstract class ZlibDecoder extends ByteToMessageDecoder
ByteBuf using the deflate algorithm.ByteToMessageDecoder.CumulatorChannelHandler.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, userEventTriggeredchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtensureNotSharable, handlerAdded, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlerAddedprotected 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–2025 The Netty Project. All rights reserved.