code::Compression Class Reference

List of all members.

Detailed Description

This is an utility class that provides various compression and uncompression strategies.

Author:
Lakshman
Version:
Id
code_Compression.h,v 1.6 2009/06/02 20:17:39 lakshman Exp


Static Public Member Functions

static Buffer compressBZ2 (const Buffer &uncompr, float factor=1.2, float maxfactor=2.0)
 Does in-memory compression similar to what is done by the UNIX executable bzip2 and returns the result.
static Buffer compressGZ (const Buffer &uncompr, float factor=1.2, float maxfactor=2.0)
 Does in-memory compression similar to what is done by the UNIX executable gzip and returns the result.
static Buffer compressZlib (const Buffer &uncompr, float factor=1.2, float maxfactor=2.0)
 Does in-memory compression similar to what is done by the zlib library and returns the result.
static Buffer uncompressBZ2 (const Buffer &input)
 Does in-memory uncompression similar to what is done by the UNIX executable bunzip2 and returns the result.
static Buffer uncompressGZ (const Buffer &input)
 Does in-memory uncompression similar to what is done by the UNIX executable gunzip and returns the result.
static Buffer uncompressZlib (const Buffer &input)
 Does in-memory uncompression similar to what is done by the zlib library and returns the result.


Member Function Documentation

static Buffer code::Compression::compressBZ2 ( const Buffer uncompr,
float  factor = 1.2,
float  maxfactor = 2.0 
) [static]

Does in-memory compression similar to what is done by the UNIX executable bzip2 and returns the result.

The result may be the uncompressed original if insufficient compression is obtained.

Parameters:
uncompr The data to compress
factor A guess at a compression ratio. 1.2 is a good pessimistic guess (20% more)
maxfactor The compression ratio beyond which we should not try to compress it.

static Buffer code::Compression::compressGZ ( const Buffer uncompr,
float  factor = 1.2,
float  maxfactor = 2.0 
) [static]

Does in-memory compression similar to what is done by the UNIX executable gzip and returns the result.

Parameters:
uncompr The data to compress
factor A guess at a compression ratio. 1.2 is a good pessimistic guess (20% more)
maxfactor The compression ratio beyond which we should not try to compress it.
The underlying zlib library guarantees that these guesses will work, so there won't be a case where insufficient compression is obtained as long as you use the defaults.

static Buffer code::Compression::compressZlib ( const Buffer uncompr,
float  factor = 1.2,
float  maxfactor = 2.0 
) [static]

Does in-memory compression similar to what is done by the zlib library and returns the result.

Parameters:
uncompr The data to compress
factor A guess at a compression ratio. 1.2 is a good pessimistic guess (20% more)
maxfactor The compression ratio beyond which we should not try to compress it.
The underlying zlib library guarantees that these guesses will work, so there won't be a case where insufficient compression is obtained as long as you use the defaults.

static Buffer code::Compression::uncompressBZ2 ( const Buffer input  )  [static]

Does in-memory uncompression similar to what is done by the UNIX executable bunzip2 and returns the result.

Parameters:
input The data to uncompress

static Buffer code::Compression::uncompressGZ ( const Buffer input  )  [static]

Does in-memory uncompression similar to what is done by the UNIX executable gunzip and returns the result.

Returns:
original data if the data is not in gzip format.
Parameters:
input The data to uncompress

static Buffer code::Compression::uncompressZlib ( const Buffer input  )  [static]

Does in-memory uncompression similar to what is done by the zlib library and returns the result.

Returns:
original data if the data is not in zlib format.
Parameters:
input The data to uncompress


Generated on Fri May 4 13:40:12 2012 for WDSS-IIw2 by  doxygen 1.4.7