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)
 
Method Summary
static int deflate(int compressionLevel, Stream in, Stream out)
          deflate a stream.
static int inflate(Stream in, Stream out)
          inflate a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Method Detail

deflate

public static int deflate(int compressionLevel,
                          Stream in,
                          Stream out)
deflate a stream.
Parameters:
compressionLevel - wanted compression level
in - uncompressed input stream
out - 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 stream
out - uncompressed output stream
Returns:
size of the uncompressed stream or -1 if an error occurred