Gunzip Class ReferenceAllows .gz files to be decompressed in memory on the fly as they are being downloaded. More...
Public Member Functions
|Gunzip (IO *ioPtr)|
|void||inject (const byte *compressed, unsigned size)|
|Called by you whenever new compressed data is available. |
|byte *||nextOut () const|
|Return current output position, i.e. |
|unsigned||availOut () const|
|Return nr of bytes left in output buffer. |
|void||setOut (byte *newNextOut, unsigned newAvailOut)|
|Supply an output buffer to place decompressed data into. |
|The Gunzip object makes calls to the virtual functions of a class you derive from this. More...|
|Pointer to an IO object, can be changed during the Gunzip object's lifetime. More...|
Detailed DescriptionAllows .gz files to be decompressed in memory on the fly as they are being downloaded.
In contrast to a gzstream-style object where calls would be made to the object to obtain decompressed data, with Gunzip calls have to be made to "push" new gzipped data to the object once available, and the Gunzip object then makes further calls, passing decompressed data to an object of your choice.
Contains code to auto-detect .gz files: If the file starts with \x1f\x8b\x08, the data is passed to zlib to decompress. Otherwise, it is assumed that the file is not compressed and it is passed to the output IO object unmodified.
Can deal with >1 concatenated .gz files; in this case, simply outputs the concatenated uncompressed data.
Constructor & Destructor Documentation
Member Function Documentation
|void Gunzip::inject||(||const byte *||compressed,|
|byte * Gunzip::nextOut||(||)|| const
Return current output position, i.e.
pointer to address where next uncompressed byte will be put.
|unsigned Gunzip::availOut||(||)|| const
Return nr of bytes left in output buffer.
|void Gunzip::setOut||(||byte *||newNextOut,|
Supply an output buffer to place decompressed data into.
This *must* be called from gunzip_needOut(), but can also be called at other times, e.g. from gunzip_data().
Member Data Documentation
The documentation for this class was generated from the following files:
Generated on Tue Sep 23 14:27:42 2008 for jigdo by 1.5.6