JZlibDecoder Class — netty Architecture
Architecture documentation for the JZlibDecoder class in JZlibDecoder.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD b9b9e638_302b_6a01_f1e0_a9d2ea3a2ab2["JZlibDecoder"] 645248c2_e8f1_d41a_676c_e6266f86884e["JZlibDecoder.java"] b9b9e638_302b_6a01_f1e0_a9d2ea3a2ab2 -->|defined in| 645248c2_e8f1_d41a_676c_e6266f86884e a242583d_1e59_6263_ea1e_26a92b6084af["JZlibDecoder()"] b9b9e638_302b_6a01_f1e0_a9d2ea3a2ab2 -->|method| a242583d_1e59_6263_ea1e_26a92b6084af 9cacc69a_3087_c845_663d_63077b0d5a82["isClosed()"] b9b9e638_302b_6a01_f1e0_a9d2ea3a2ab2 -->|method| 9cacc69a_3087_c845_663d_63077b0d5a82 78a72dfa_575b_382e_4f57_622743a22188["decode()"] b9b9e638_302b_6a01_f1e0_a9d2ea3a2ab2 -->|method| 78a72dfa_575b_382e_4f57_622743a22188 13260857_fb05_6d06_80c1_0099b69a4481["channelReadComplete()"] b9b9e638_302b_6a01_f1e0_a9d2ea3a2ab2 -->|method| 13260857_fb05_6d06_80c1_0099b69a4481 21581ab9_676f_ef82_3036_47d3cb8729d7["decompressionBufferExhausted()"] b9b9e638_302b_6a01_f1e0_a9d2ea3a2ab2 -->|method| 21581ab9_676f_ef82_3036_47d3cb8729d7
Relationship Graph
Source Code
codec-compression/src/main/java/io/netty/handler/codec/compression/JZlibDecoder.java lines 27–249
public class JZlibDecoder extends ZlibDecoder {
private final Inflater z = new Inflater();
private byte[] dictionary;
private boolean needsRead;
private volatile boolean finished;
/**
* Creates a new instance with the default wrapper ({@link ZlibWrapper#ZLIB}).
*
* @throws DecompressionException if failed to initialize zlib
* @deprecated Use {@link JZlibDecoder#JZlibDecoder(int)}.
*/
@Deprecated
public JZlibDecoder() {
this(ZlibWrapper.ZLIB, 0);
}
/**
* Creates a new instance with the default wrapper ({@link ZlibWrapper#ZLIB})
* and specified maximum buffer allocation.
*
* @param maxAllocation
* Maximum size of the decompression buffer. Must be >= 0.
* If zero, maximum size is decided by the {@link ByteBufAllocator}.
*
* @throws DecompressionException if failed to initialize zlib
*/
public JZlibDecoder(int maxAllocation) {
this(ZlibWrapper.ZLIB, maxAllocation);
}
/**
* Creates a new instance with the specified wrapper.
*
* @throws DecompressionException if failed to initialize zlib
* @deprecated Use {@link JZlibDecoder#JZlibDecoder(ZlibWrapper, int)}.
*/
@Deprecated
public JZlibDecoder(ZlibWrapper wrapper) {
this(wrapper, 0);
}
/**
* Creates a new instance with the specified wrapper and maximum buffer allocation.
*
* @param maxAllocation
* Maximum size of the decompression buffer. Must be >= 0.
* If zero, maximum size is decided by the {@link ByteBufAllocator}.
*
* @throws DecompressionException if failed to initialize zlib
*/
public JZlibDecoder(ZlibWrapper wrapper, int maxAllocation) {
super(maxAllocation);
ObjectUtil.checkNotNull(wrapper, "wrapper");
int resultCode = z.init(ZlibUtil.convertWrapperType(wrapper));
if (resultCode != JZlib.Z_OK) {
ZlibUtil.fail(z, "initialization failure", resultCode);
}
}
/**
* Creates a new instance with the specified preset dictionary. The wrapper
* is always {@link ZlibWrapper#ZLIB} because it is the only format that
* supports the preset dictionary.
*
* @throws DecompressionException if failed to initialize zlib
* @deprecated Use {@link JZlibDecoder#JZlibDecoder(byte[], int)}.
*/
@Deprecated
public JZlibDecoder(byte[] dictionary) {
this(dictionary, 0);
}
/**
* Creates a new instance with the specified preset dictionary and maximum buffer allocation.
* The wrapper is always {@link ZlibWrapper#ZLIB} because it is the only format that
* supports the preset dictionary.
*
Source
Frequently Asked Questions
What is the JZlibDecoder class?
JZlibDecoder is a class in the netty codebase, defined in codec-compression/src/main/java/io/netty/handler/codec/compression/JZlibDecoder.java.
Where is JZlibDecoder defined?
JZlibDecoder is defined in codec-compression/src/main/java/io/netty/handler/codec/compression/JZlibDecoder.java at line 27.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free