CMS 3D CMS Logo

lat::DecompressInputStream Class Reference

A stream filter to decompress the input data. More...

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

Inheritance diagram for lat::DecompressInputStream:

lat::FilterInputStream lat::InputStream lat::IOInput lat::BZIPInputStream lat::ZInputStream lat::GZIPInputStream lat::ZipInputStream

List of all members.

Public Types

enum  { DEFAULT_BUF_SIZE = 4096 }

Public Member Functions

virtual IOSize available (void)
virtual unsigned checksum (void) const
virtual void close (void)
 DecompressInputStream (Decompressor *decompressor, Checksum *checksum, InputStream *input, IOSize bufsize=DEFAULT_BUF_SIZE)
virtual IOSize read (void *into, IOSize n)
virtual IOSize skip (IOSize n)
 ~DecompressInputStream (void)

Protected Member Functions

virtual IOSize fill (void *buffer, IOSize length)

Protected Attributes

unsigned char * m_buffer
Checksumm_checksum
Decompressorm_decompressor
IOSize m_last
IOSize m_size

Private Member Functions

 DecompressInputStream (const DecompressInputStream &)
DecompressInputStreamoperator= (const DecompressInputStream &)
void unread (void)


Detailed Description

A stream filter to decompress the input data.

This class is a filtering stream that decompresses the input using the specified decompression engine. Please refer to the inherited classes for implementations with specific decompression engines.

Objects of this class have an internal buffer in which they buffer the compressed input for the decompressor to work on. It has nothing to do with the compression level or the buffers internal to the decompression engine -- it is merely used as a working area for the decompressor as data is read from upstream. Thus its size only affects the efficiency of the input operations and the decompressor call overhead (the amount of data that can be decompressed at a time). Choose the buffer size accordingly.

Reads from this stream block: each read loops reading input data into the decompressor until at least some output can be returned. Depending on the decompressor engine and the input stream, large amounts of input may be consumed before any output is generated. On the other hand, little or no input may in the end trigger the output of large amounts of uncompressed data. This class is therefore not suited for interactive use and cannot be used with non-blocking output streams; InteractiveDecompressor provides a class designed to work in such conditions.

It is not possible to tell beforehand when the end of the compressed input stream will be reached. As this class reads input from upstream channel in chunks of its internal buffer size, it may read up to one buffer's worth too much ahead. The input that was not used is pushed back to the upstream input via an intermediate PushBackInputStream inserted by this class before the upstream input. Derived classes should make sure to use m_input, not the input stream they pass to the constructor.

Definition at line 55 of file DecompressInputStream.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
DEFAULT_BUF_SIZE 

Definition at line 58 of file DecompressInputStream.h.

00058 { DEFAULT_BUF_SIZE = 4096 };


Constructor & Destructor Documentation

lat::DecompressInputStream::DecompressInputStream ( Decompressor decompressor,
Checksum checksum,
InputStream input,
IOSize  bufsize = DEFAULT_BUF_SIZE 
)

lat::DecompressInputStream::~DecompressInputStream ( void   ) 

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


Member Function Documentation

virtual IOSize lat::DecompressInputStream::available ( void   )  [virtual]

Reimplemented from lat::FilterInputStream.

Reimplemented in lat::ZipInputStream.

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

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

Reimplemented from lat::FilterInputStream.

Reimplemented in lat::ZipInputStream.

virtual IOSize lat::DecompressInputStream::fill ( void buffer,
IOSize  length 
) [protected, virtual]

Reimplemented in lat::ZipInputStream.

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

virtual IOSize lat::DecompressInputStream::read ( void into,
IOSize  n 
) [virtual]

Reimplemented from lat::FilterInputStream.

Reimplemented in lat::GZIPInputStream, and lat::ZipInputStream.

virtual IOSize lat::DecompressInputStream::skip ( IOSize  n  )  [virtual]

Reimplemented from lat::FilterInputStream.

Reimplemented in lat::ZipInputStream.

void lat::DecompressInputStream::unread ( void   )  [private]


Member Data Documentation

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

Definition at line 81 of file DecompressInputStream.h.

Checksum* lat::DecompressInputStream::m_checksum [protected]

Definition at line 80 of file DecompressInputStream.h.

Decompressor* lat::DecompressInputStream::m_decompressor [protected]

Definition at line 79 of file DecompressInputStream.h.

IOSize lat::DecompressInputStream::m_last [protected]

Definition at line 83 of file DecompressInputStream.h.

IOSize lat::DecompressInputStream::m_size [protected]

Definition at line 82 of file DecompressInputStream.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