superwaba.ext.xplat.util.zip
Class JZlib
java.lang.Object
|
+--superwaba.ext.xplat.util.zip.JZlib
- public final class JZlib
- extends java.lang.Object
A Java implementation of the Zip library
|
Constructor Summary |
JZlib()
|
|
Method Summary |
static byte[] |
deflate(byte[] txtbyte,
int compressionLevel)
Deflate an uncompressed buffer. |
static byte[] |
inflate(byte[] txtbyte)
Inflates a compressed buffer. |
static byte[] |
inflate(byte[] txtbyte,
int factor)
Inflates a compressed buffer. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Z_NO_COMPRESSION
public static final int Z_NO_COMPRESSION
Z_BEST_SPEED
public static final int Z_BEST_SPEED
Z_BEST_COMPRESSION
public static final int Z_BEST_COMPRESSION
Z_DEFAULT_COMPRESSION
public static final int Z_DEFAULT_COMPRESSION
Z_FILTERED
public static final int Z_FILTERED
Z_HUFFMAN_ONLY
public static final int Z_HUFFMAN_ONLY
Z_DEFAULT_STRATEGY
public static final int Z_DEFAULT_STRATEGY
Z_NO_FLUSH
public static final int Z_NO_FLUSH
Z_PARTIAL_FLUSH
public static final int Z_PARTIAL_FLUSH
Z_SYNC_FLUSH
public static final int Z_SYNC_FLUSH
Z_FULL_FLUSH
public static final int Z_FULL_FLUSH
Z_FINISH
public static final int Z_FINISH
Z_OK
public static final int Z_OK
Z_STREAM_END
public static final int Z_STREAM_END
Z_NEED_DICT
public static final int Z_NEED_DICT
Z_ERRNO
public static final int Z_ERRNO
Z_STREAM_ERROR
public static final int Z_STREAM_ERROR
Z_DATA_ERROR
public static final int Z_DATA_ERROR
Z_MEM_ERROR
public static final int Z_MEM_ERROR
Z_BUF_ERROR
public static final int Z_BUF_ERROR
Z_VERSION_ERROR
public static final int Z_VERSION_ERROR
status
public static java.lang.String status
- String that contains the inflate/deflate status, already separated using |.
JZlib
public JZlib()
inflate
public static byte[] inflate(byte[] txtbyte)
throws java.lang.Exception
- Inflates a compressed buffer.
- Parameters:
txtbyte - - Returns:
- the uncompressed byte array or null if the buffer is too small
inflate
public static byte[] inflate(byte[] txtbyte,
int factor)
throws java.lang.Exception
- Inflates a compressed buffer.
- Parameters:
txtbyte - compressed byte arrayfactor - estimated compression factor - guich@504_3: ignored- Returns:
- the uncompressed byte array or null if the buffer is too small
deflate
public static byte[] deflate(byte[] txtbyte,
int compressionLevel)
throws java.lang.Exception
- Deflate an uncompressed buffer.
- Parameters:
txtbyte - byte array to compresscompressionLevel - values are 0 (no compression), 1 (min compression) to 9 (max compression)- Returns:
- the compressed byte array