Logo Search packages:      
Sourcecode: jigdo version File versions

Zobstream Class Reference

#include <zstream.hh>

List of all members.

Detailed Description

Output stream which compresses the data sent to it before writing it to its final destination. The b is for buffered - this class will buffer *all* generated output in memory until the bytes written to the underlying stream (i.e. the compressed data) exceed chunkLimit - once this happens, the zlib data is flushed and the resultant compressed chunk written out with a header (cf ../doc/TechDetails.txt for format). This is jigdo-specific.

Additional features mainly useful for jigdo: If an MD5Sum object is passed to Zobstream(), any data written to the output stream is also passed to the object.

Definition at line 53 of file zstream.hh.

Public Member Functions

void close ()
 Forces any remaining data to be compressed and written out.
bostream & getStream ()
 Get reference to underlying ostream.
bool is_open () const
void open (bostream &s, size_t chunkLimit, int level=Z_DEFAULT_COMPRESSION, int windowBits=15, int memLevel=8, size_t todoBufSz=256U)
Zobstreamput (uint32 x)
 Output 32 bit integer in little-endian order.
Zobstreamput (char x)
Zobstreamput (int x)
 Output the low 8 bits of an integer.
Zobstreamput (signed char x)
Zobstreamput (unsigned char x)
 Output 1 character.
Zobstreamwrite (const byte *x, size_t n)
 Output n characters.
 Zobstream (bostream &s, size_t chunkLimit, int level=Z_DEFAULT_COMPRESSION, int windowBits=15, int memLevel=8, size_t todoBufSz=256U, MD5Sum *md=0)
 Zobstream (MD5Sum *md=0)
 ~Zobstream ()

Private Member Functions

void throwZerror (int status, const char *zmsg)
void writeZipped ()
void zip (byte *start, size_t len, int flush=Z_NO_FLUSH)

Private Attributes

size_t chunkLim
bostream * stream
byte * todoBuf
size_t todoBufSize
size_t todoCount
z_stream z
ZipData * zipBuf
ZipData * zipBufLast

Static Private Attributes

static const size_t MIN_TODOBUF_SIZE = 256
static const size_t ZIPDATA_SIZE = 64*1024


struct  ZipData

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index