public class ZlibDecoder extends OneToOneDecoder
ChannelBuffer using the deflate algorithm.ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
private byte[] |
dictionary |
private boolean |
finished |
private com.jcraft.jzlib.ZStream |
z |
| Constructor and Description |
|---|
ZlibDecoder()
Creates a new instance with the default wrapper (
ZlibWrapper.ZLIB). |
ZlibDecoder(byte[] dictionary)
Creates a new instance with the specified preset dictionary.
|
ZlibDecoder(ZlibWrapper wrapper)
Creates a new instance with the specified wrapper.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
decode(ChannelHandlerContext ctx,
Channel channel,
java.lang.Object msg)
Transforms the specified received message into another message and return
the transformed message.
|
boolean |
isClosed()
Returns
true if and only if the end of the compressed stream
has been reached. |
handleUpstreamprivate final com.jcraft.jzlib.ZStream z
private byte[] dictionary
private volatile boolean finished
public ZlibDecoder()
ZlibWrapper.ZLIB).CompressionException - if failed to initialize zlibpublic ZlibDecoder(ZlibWrapper wrapper)
CompressionException - if failed to initialize zlibpublic ZlibDecoder(byte[] dictionary)
ZlibWrapper.ZLIB because it is the only format that
supports the preset dictionary.CompressionException - if failed to initialize zlibpublic boolean isClosed()
true if and only if the end of the compressed stream
has been reached.protected java.lang.Object decode(ChannelHandlerContext ctx, Channel channel, java.lang.Object msg) throws java.lang.Exception
OneToOneDecodernull if the received message
is supposed to be discarded.decode in class OneToOneDecoderjava.lang.Exception