CMS 3D CMS Logo

lat::CompressOutputStream Class Reference

A stream filter to compress the output data. More...

#include <Iguana/Utilities/classlib/zip/CompressOutputStream.h>

Inheritance diagram for lat::CompressOutputStream:

lat::FilterOutputStream lat::OutputStream lat::IOOutput lat::BZIPOutputStream lat::ZOutputStream lat::GZIPOutputStream lat::ZipOutputStream

List of all members.

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
Checksumm_checksum
Compressorm_compressor
bool m_finished
IOSize m_size

Private Member Functions

 CompressOutputStream (const CompressOutputStream &)
CompressOutputStreamoperator= (const CompressOutputStream &)


Detailed Description

A stream filter to compress the output data.

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.


Member Enumeration Documentation

anonymous enum

Enumerator:
DEFAULT_BUF_SIZE 

Definition at line 51 of file CompressOutputStream.h.

00051 { DEFAULT_BUF_SIZE = 4096 };


Constructor & Destructor Documentation

lat::CompressOutputStream::CompressOutputStream ( Compressor compressor,
Checksum checksum,
OutputStream output,
IOSize  bufsize = DEFAULT_BUF_SIZE 
)

lat::CompressOutputStream::~CompressOutputStream ( void   ) 

lat::CompressOutputStream::CompressOutputStream ( const CompressOutputStream  )  [private]


Member Function Documentation

virtual unsigned lat::CompressOutputStream::checksum ( void   )  const [virtual]

virtual void lat::CompressOutputStream::close ( void   )  [virtual]

Reimplemented from lat::FilterOutputStream.

Reimplemented in lat::ZipOutputStream.

virtual void lat::CompressOutputStream::compress ( void   )  [protected, virtual]

virtual void lat::CompressOutputStream::finish ( void   )  [virtual]

Reimplemented from lat::FilterOutputStream.

Reimplemented in lat::GZIPOutputStream, and lat::ZipOutputStream.

virtual void lat::CompressOutputStream::flush ( void   )  [virtual]

CompressOutputStream& lat::CompressOutputStream::operator= ( const CompressOutputStream  )  [private]

virtual void lat::CompressOutputStream::restart ( void   )  [protected, virtual]

virtual IOSize lat::CompressOutputStream::write ( const void from,
IOSize  n 
) [virtual]

Reimplemented from lat::FilterOutputStream.

Reimplemented in lat::ZipOutputStream.


Member Data Documentation

unsigned char* lat::CompressOutputStream::m_buffer [protected]

Reimplemented in lat::ZipOutputStream.

Definition at line 73 of file CompressOutputStream.h.

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]

Reimplemented in lat::ZipOutputStream.

Definition at line 75 of file CompressOutputStream.h.

IOSize lat::CompressOutputStream::m_size [protected]

Definition at line 74 of file CompressOutputStream.h.


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:48:24 2009 for CMSSW by  doxygen 1.5.4