CompressTool

A tool to losslessly compress data, and expand the compressed data again.

Methods
byte[] compress(byte[] in, String algorithm)
Compressed the data using the specified algorithm.
byte[] expand(byte[] in)
Expands the compressed data.
static CompressTool getInstance()
Get the singleton.

byte[] compress(byte[] in, String algorithm) throws SQLException

Compressed the data using the specified algorithm. If no algorithm is supplied, LZF is used

Parameters:
in - the byte array with the original data
algorithm - the algorithm (LZF, DEFLATE)
Returns:
the compressed data
Throws:
SQLException - if a error occurs

byte[] expand(byte[] in) throws SQLException

Expands the compressed data.

Parameters:
in - the byte array with the compressed data
Returns:
the uncompressed data
Throws:
SQLException - if a error occurs

static CompressTool getInstance()

Get the singleton.

Returns:
the singleton