|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jcraft.jzlib.JZlib
public final class JZlib
This static class holds all the constants used by the compression and decompression algorithms.
There is no point in creating instances of this class.
The constants here are in these groups:
Z_NO_COMPRESSION
, Z_BEST_SPEED
,
Z_BEST_COMPRESSION
, Z_DEFAULT_COMPRESSION
Z_FILTERED
, Z_HUFFMAN_ONLY
,
Z_DEFAULT_STRATEGY
.Z_NO_FLUSH
, Z_PARTIAL_FLUSH
,
Z_SYNC_FLUSH
, Z_FULL_FLUSH
, Z_FINISH
.Z_OK
, Z_STREAM_END
, Z_NEED_DICT
,
Z_ERRNO
, Z_STREAM_ERROR
, Z_DATA_ERROR
,
Z_MEM_ERROR
, Z_BUF_ERROR
, Z_VERSION_ERROR
.
Additionally, the version()
method provides the corresponding
zlib version string.
The documentation is partly copied or paraphrased from the zlib manual.
Field Summary | |
---|---|
static int |
Z_BEST_COMPRESSION
Compression level constant for maximal compression, for use with ZStream.deflateInit(int) . |
static int |
Z_BEST_SPEED
Compression level constant for best speed, for use with ZStream.deflateInit(int) . |
static int |
Z_BUF_ERROR
Return code constant for deflate, inflate, deflateParams, inflateSync. |
static int |
Z_DATA_ERROR
Return code constant for deflateEnd, inflate, inflateSetDictionary, inflateSync. |
static int |
Z_DEFAULT_COMPRESSION
Compression level constant for default compression, for use with ZStream.deflateInit(int) . |
static int |
Z_DEFAULT_STRATEGY
Compression strategy constant: default strategy. |
static int |
Z_ERRNO
Return code constant for errors outside of the compression library. |
static int |
Z_FILTERED
Compression strategy constant for filtered data. |
static int |
Z_FINISH
Flushing type constant: finish. |
static int |
Z_FULL_FLUSH
Flushing type constant: full flush. |
static int |
Z_HUFFMAN_ONLY
Compression strategy constant: use only Huffman encoding (no string match). |
static int |
Z_MEM_ERROR
Return code constant, not used by JZlib. |
static int |
Z_NEED_DICT
Return code constant for inflate: need dictionary. |
static int |
Z_NO_COMPRESSION
Compression level constant for no compression, for use with ZStream.deflateInit(int) . |
static int |
Z_NO_FLUSH
Flushing type constant: no flush. |
static int |
Z_OK
Return code constant for inflate/deflate (and most other methods): Okay. |
static int |
Z_PARTIAL_FLUSH
Flushing type constant: partial flush. |
static int |
Z_STREAM_END
Return code constant for inflate/deflate: stream end. |
static int |
Z_STREAM_ERROR
Return code constant for deflateInit, deflate, deflateEnd, inflateInit, inflate, inflateEnd, deflateSetDictionary, deflateParams, inflateSetDictionary, inflateSync, This means the stream state is inconsistent, or the parameters are not valid (for the configuration methods). |
static int |
Z_SYNC_FLUSH
Flushing type constant: synchronizing flush. |
static int |
Z_VERSION_ERROR
Return code constant, not used by JZlib. |
Constructor Summary | |
---|---|
JZlib()
|
Method Summary | |
---|---|
static String |
version()
returns the zlib version number this library is derived from. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int Z_NO_COMPRESSION
ZStream.deflateInit(int)
.
public static final int Z_BEST_SPEED
ZStream.deflateInit(int)
.
public static final int Z_BEST_COMPRESSION
ZStream.deflateInit(int)
.
public static final int Z_DEFAULT_COMPRESSION
ZStream.deflateInit(int)
.
public static final int Z_FILTERED
ZStream.deflateParams(int, int)
.
Filtered data consists mostly of small values with
a somewhat random distribution.
public static final int Z_HUFFMAN_ONLY
ZStream.deflateParams(int, int)
.
public static final int Z_DEFAULT_STRATEGY
ZStream.deflateParams(int, int)
.
Use this for normal data.
public static final int Z_NO_FLUSH
ZStream.deflate(int)
and ZStream.inflate(int)
.
This should be used normally for compression, since it allows
the library to decide how much data to collect before compressing
it, maximizing the compression.
For decompression, this will produce as much output as
the library deems appropriate.
public static final int Z_PARTIAL_FLUSH
ZStream.deflate(int)
and ZStream.inflate(int)
.
For compression, this will flush all output to far to the output
buffer, completing the block and following it with an empty block.
The output is not necessarily aligned with a byte boundary, but the
empty block makes sure that the data so far is included in full bytes
in the output.
public static final int Z_SYNC_FLUSH
ZStream.deflate(int)
and ZStream.inflate(int)
.
For compression, this will flush all output so far to the output
buffer and align it on a byte boundary, so everything which was
input before can be consumed at the output side.
It finishes the current block and adds an empty block.
This should not be used to often, as it degrades compression
for some algorithms.
For decompression, this requests to flush as much output as possible
to the output buffer.
public static final int Z_FULL_FLUSH
ZStream.deflate(int)
and ZStream.inflate(int)
.
For compression, this flushes all output like Z_SYNC_FLUSH
,
and then resets the compression state, so decompression can restart from
here (with inflateSync) if the data is damaged.
Don't use this too often, as it seriously degrades performance.
public static final int Z_FINISH
ZStream.deflate(int)
and ZStream.inflate(int)
.
For compression, this flushes all output and then finishes up the
stream. If there is enough output space, then the stream must be either
closed or reset.
For decompression, this will make sure that the stream will be
decompressed completely, returning Z_BUF_ERROR
if there
is not enough output space.
public static final int Z_OK
public static final int Z_STREAM_END
Z_FINISH
as
the flush parameter, all input was processed and completely flushed
to the output.
For decompression, this means that the end of the compressed stream
is reached and fully decompressed.
public static final int Z_NEED_DICT
ZStream.inflateSetDictionary(byte[], int)
should be called.
The Adler32 checksum of the needed dictionary is in ZStream.adler
.
public static final int Z_ERRNO
public static final int Z_STREAM_ERROR
public static final int Z_DATA_ERROR
public static final int Z_MEM_ERROR
OutOfMemoryError
instead.
public static final int Z_BUF_ERROR
public static final int Z_VERSION_ERROR
Constructor Detail |
---|
public JZlib()
Method Detail |
---|
public static String version()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |