Gilles Vollant Guest
|
Posted: Sun Aug 24, 2003 6:07 pm Post subject: What free library support stream compression ? |
|
|
I>m trying make a list of free compression code that support a "stream" like
API.
By stream library, I mean you have a structure like
typedef struct
{
typedef struct {
void *next_in; /* next input byte */
unsigned int avail_in; /* number of bytes available at next_in */
void *next_out; /* next out byte */
unsigned int avail_out; /* number of bytes available at next_out */
} stream_compress;
and for compress or uncompress, you call a function with a stream_compress
structure, and you put what you want in this structure (you only need
avail_in and / or avail_out not null).
Of course, the first and well known library is zLib (
http://www.gzip.org/zlib/ ) with deflate compression.
I discover that BZip 2 ( http://sources.redhat.com/bzip2/ ) also support
these stream function.
If I well understand, LZO ( http://www.oberhumer.com/opensource/lzo/ ) also.
Pehaps I will write a small wrapper to unify all these library : in Init,
you>ll select between zLib, BZip2, lzo (and uncompressed storage) with all
possible Init parameter..., and after, we will have a compress, uncompress
and close function
And pehaps, after, I>ll use this wrapper in minizip project (
http://www.winimage.com/zLibDll/unzip.html ) if I decide support BZip 2
compression introducted in .Zip format by PKWare
http://www.pkware.com/products/enterprise/white_papers/appnote.html#bzip2 ) |
|