#include <Iguana/Utilities/classlib/zip/CompressOutputStream.h>
Public Types | |
enum | { DEFAULT_BUF_SIZE = 4096 } |
Public Member Functions | |
virtual unsigned | checksum (void) const |
virtual void | close (void) |
CompressOutputStream (Compressor *compressor, Checksum *checksum, OutputStream *output, IOSize bufsize=DEFAULT_BUF_SIZE) | |
virtual void | finish (void) |
virtual void | flush (void) |
virtual IOSize | write (const void *from, IOSize n) |
~CompressOutputStream (void) | |
Protected Member Functions | |
virtual void | compress (void) |
virtual void | restart (void) |
Protected Attributes | |
unsigned char * | m_buffer |
Checksum * | m_checksum |
Compressor * | m_compressor |
bool | m_finished |
IOSize | m_size |
Private Member Functions | |
CompressOutputStream (const CompressOutputStream &) | |
CompressOutputStream & | operator= (const CompressOutputStream &) |
This class is a filtering stream that compresses the output sent to it using the specified compression engine. You will probably want to refer to the inherited classes for implementations with specific compression engines.
Objects of this class have an internal buffer in which they buffer the compressed output before writing it out downstream. It has nothing to do with the compression level or the buffers internal to the compression engine -- it is merely used to collect output from the compressor before writing it out downstream. Thus its size does not affect the quality of the compression, only the efficiency of the output operations. Choose the buffer size accordingly.
Writes to this stream block: each write loops pushing input data into the compressor and compressed data downstream until all the provided input has been processed. Depending on the compressor engine and the provided input, large amounts of input -- hundreds of kilobytes -- may be consumed before any output is generated. On the other hand, a single byte of input may in the end trigger the output of large amounts of compressed data. This class is therefore not suited for interactive use and cannot be used with non-blocking output streams; provides a replacement designed to work in such conditions.
Definition at line 48 of file CompressOutputStream.h.
anonymous enum |
lat::CompressOutputStream::CompressOutputStream | ( | Compressor * | compressor, | |
Checksum * | checksum, | |||
OutputStream * | output, | |||
IOSize | bufsize = DEFAULT_BUF_SIZE | |||
) |
lat::CompressOutputStream::~CompressOutputStream | ( | void | ) |
lat::CompressOutputStream::CompressOutputStream | ( | const CompressOutputStream & | ) | [private] |
virtual unsigned lat::CompressOutputStream::checksum | ( | void | ) | const [virtual] |
Reimplemented from lat::FilterOutputStream.
Reimplemented in lat::GZIPOutputStream, and lat::ZipOutputStream.
CompressOutputStream& lat::CompressOutputStream::operator= | ( | const CompressOutputStream & | ) | [private] |
unsigned char* lat::CompressOutputStream::m_buffer [protected] |
Checksum* lat::CompressOutputStream::m_checksum [protected] |
Definition at line 72 of file CompressOutputStream.h.
Compressor* lat::CompressOutputStream::m_compressor [protected] |
Definition at line 71 of file CompressOutputStream.h.
bool lat::CompressOutputStream::m_finished [protected] |
IOSize lat::CompressOutputStream::m_size [protected] |
Definition at line 74 of file CompressOutputStream.h.