public abstract class ZlibDecoder extends ByteToMessageDecoder
ByteBuf
using the deflate algorithm.ByteToMessageDecoder.Cumulator
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(io.netty.buffer.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 io.netty.buffer.ByteBuf |
prepareDecompressBuffer(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.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
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 io.netty.buffer.ByteBuf prepareDecompressBuffer(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf buffer, int preferredSize)
decompressionBufferExhausted(ByteBuf)
if the buffer is full and cannot be expanded further.protected void decompressionBufferExhausted(io.netty.buffer.ByteBuf buffer)
DecompressionException
is thrown, such as log the
data that was decompressed so far.Copyright © 2008–2021 The Netty Project. All rights reserved.