public class Zlib
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
COMPRESSION_DEFAULT |
static int |
COMPRESSION_MAX |
static int |
COMPRESSION_MIN |
static int |
COMPRESSION_NONE |
static int |
MODE_DEFLATER |
static int |
MODE_INFLATER |
| Constructor and Description |
|---|
Zlib(int compressionLevel,
int mode) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp()
Cleans up the resources used by the compression library.
|
org.apache.mina.common.ByteBuffer |
deflate(org.apache.mina.common.ByteBuffer inBuffer) |
org.apache.mina.common.ByteBuffer |
inflate(org.apache.mina.common.ByteBuffer inBuffer) |
public static final int COMPRESSION_MAX
public static final int COMPRESSION_MIN
public static final int COMPRESSION_NONE
public static final int COMPRESSION_DEFAULT
public static final int MODE_DEFLATER
public static final int MODE_INFLATER
public Zlib(int compressionLevel,
int mode)
compressionLevel - the level of compression that should be usedmode - the mode in which the instance will operate. Can be either
of MODE_DEFLATER or MODE_INFLATERpublic org.apache.mina.common.ByteBuffer inflate(org.apache.mina.common.ByteBuffer inBuffer)
throws java.io.IOException
inBuffer - the ByteBuffer to be decompressed. The contents
of the buffer are transferred into a local byte array and the buffer is
flipped and returned intact.java.io.IOException - if the decompression of the data failed for some reason.public org.apache.mina.common.ByteBuffer deflate(org.apache.mina.common.ByteBuffer inBuffer)
throws java.io.IOException
inBuffer - the buffer to be compressed. The contents are transferred
into a local byte array and the buffer is flipped and returned intact.java.io.IOException - if the compression of teh buffer failed for some reasonpublic void cleanUp()