GeezerVison is showing netty.io — JZlibDecoder (Netty API Reference (4.1.141.Final))
Class JZlibDecoder
-
-
Field Summary
Fields inherited from class ZlibDecoder
maxAllocation
Modifier and Type
Field
Description
protected final int
Maximum allowed size of the decompression buffer.
-
Constructor Summary
Constructors
Constructor
Description
Creates a new instance with the specified preset dictionary and maximum buffer allocation.
Creates a new instance with the default wrapper ( ZlibWrapper.ZLIB)
and specified maximum buffer allocation.
Creates a new instance with the specified wrapper and maximum buffer allocation.
-
Method Summary
Modifier and Type
Method
Description
void
protected void
Decode the from one ByteBuf to an other.
protected void
Called when the decompression buffer cannot be expanded further.
boolean
Returns true if and only if the end of the compressed stream
has been reached.
Methods inherited from class ZlibDecoder
prepareDecompressBuffer
Modifier and Type
Method
Description
Allocate or expand the decompression buffer, without exceeding the maximum allocation.
actualReadableBytes, callDecode, channelInactive, channelRead, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
Modifier and Type
Method
Description
protected int
Returns the actual number of readable bytes in the internal cumulative
buffer of this decoder.
protected void
Called once data should be decoded from the given ByteBuf.
void
void
protected void
protected final void
final void
Do nothing by default, sub-classes may override this method.
protected void
Gets called after the ByteToMessageDecoder was removed from the actual context and it doesn't handle
events anymore.
Returns the internal cumulative buffer of this decoder.
boolean
void
void
void
void
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
-
JZlibDecoder
public JZlibDecoder(int maxAllocation)
Creates a new instance with the default wrapper ( ZlibWrapper.ZLIB)
and specified maximum buffer allocation.
- Parameters:
maxAllocation - Maximum size of the decompression buffer. Must be >= 0.
If zero, maximum size is decided by the ByteBufAllocator.
- Throws:
DecompressionException - if failed to initialize zlib
-
JZlibDecoder
Creates a new instance with the specified wrapper.
- Throws:
DecompressionException - if failed to initialize zlib
-
JZlibDecoder
public JZlibDecoder(ZlibWrapper wrapper,
int maxAllocation)
Creates a new instance with the specified wrapper and maximum buffer allocation.
- Parameters:
maxAllocation - Maximum size of the decompression buffer. Must be >= 0.
If zero, maximum size is decided by the ByteBufAllocator.
- Throws:
DecompressionException - if failed to initialize zlib
-
JZlibDecoder
Creates a new instance with the specified preset dictionary. The wrapper
is always ZlibWrapper.ZLIB because it is the only format that
supports the preset dictionary.
- Throws:
DecompressionException - if failed to initialize zlib
-
JZlibDecoder
public JZlibDecoder(byte[] dictionary,
int maxAllocation)
Creates a new instance with the specified preset dictionary and maximum buffer allocation.
The wrapper is always ZlibWrapper.ZLIB because it is the only format that
supports the preset dictionary.
- Parameters:
maxAllocation - Maximum size of the decompression buffer. Must be >= 0.
If zero, maximum size is decided by the ByteBufAllocator.
- Throws:
DecompressionException - if failed to initialize zlib
-
Method Details
-
isClosed
public boolean isClosed()
Returns true if and only if the end of the compressed stream
has been reached.
- Specified by:
isClosed in class ZlibDecoder
-
-
-
decompressionBufferExhausted
protected void decompressionBufferExhausted(ByteBuf buffer)
Called when the decompression buffer cannot be expanded further.
Default implementation is a no-op, but subclasses can override in case they want to
do something before the DecompressionException is thrown, such as log the
data that was decompressed so far.
- Overrides:
decompressionBufferExhausted in class ZlibDecoder
|