superwaba.ext.xplat.zlib
Class ZLib
java.lang.Object
|
+--superwaba.ext.xplat.zlib.ZLib
- public final class ZLib
- extends java.lang.Object
This package implements stream compression with the ZLib library.
|
Field Summary |
static int |
BEST_COMPRESSION
Compression level for best compression, which is 9 in a scale from 0 (less) to 9 (more). |
static int |
BEST_SPEED
Compression level for fastest compression, which is 1 in a scale from 0 (less) to 9 (more). |
static int |
DEFAULT_COMPRESSION
|
static int |
NO_COMPRESSION
No compression, which is 0 in a scale from 0 (less) to 9 (more) |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
NO_COMPRESSION
public static final int NO_COMPRESSION
- No compression, which is 0 in a scale from 0 (less) to 9 (more)
BEST_SPEED
public static final int BEST_SPEED
- Compression level for fastest compression, which is 1 in a scale from 0 (less) to 9 (more).
BEST_COMPRESSION
public static final int BEST_COMPRESSION
- Compression level for best compression, which is 9 in a scale from 0 (less) to 9 (more).
DEFAULT_COMPRESSION
public static final int DEFAULT_COMPRESSION
deflate
public static int deflate(int compressionLevel,
Stream in,
Stream out)
- deflate a stream.
- Parameters:
compressionLevel - wanted compression levelin - uncompressed input streamout - compressed output stream- Returns:
- size of the compressed stream or -1 if an error occurred
inflate
public static int inflate(Stream in,
Stream out)
- inflate a stream.
- Parameters:
in - compressed input streamout - uncompressed output stream- Returns:
- size of the uncompressed stream or -1 if an error occurred