anon.util
Class ZLibTools

java.lang.Object
  extended by anon.util.ZLibTools

public final class ZLibTools
extends java.lang.Object

This class provides some utility methods for ZLib compression.


Constructor Summary
ZLibTools()
           
 
Method Summary
static byte[] compress(byte[] a_data)
          Compresses the specified data with ZLib in the best compression mode.
static byte[] decompress(byte[] a_data)
          Decompresses the specified data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZLibTools

public ZLibTools()
Method Detail

compress

public static byte[] compress(byte[] a_data)
Compresses the specified data with ZLib in the best compression mode.

Parameters:
a_data - The data to compress.
Returns:
The compressed data or null, if there was an error while the compression.

decompress

public static byte[] decompress(byte[] a_data)
Decompresses the specified data.

Parameters:
a_data - The ZLib compressed data (whole block, not only parts).
Returns:
The uncompressed data or null, if the specified data are not ZLib compressed.