#include <Iguana/Utilities/classlib/zip/DecompressInputStream.h>
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 |
Checksum * | m_checksum |
Decompressor * | m_decompressor |
IOSize | m_last |
IOSize | m_size |
Private Member Functions | |
DecompressInputStream (const DecompressInputStream &) | |
DecompressInputStream & | operator= (const DecompressInputStream &) |
void | unread (void) |
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.
anonymous enum |
lat::DecompressInputStream::DecompressInputStream | ( | Decompressor * | decompressor, | |
Checksum * | checksum, | |||
InputStream * | input, | |||
IOSize | bufsize = DEFAULT_BUF_SIZE | |||
) |
lat::DecompressInputStream::~DecompressInputStream | ( | void | ) |
lat::DecompressInputStream::DecompressInputStream | ( | const DecompressInputStream & | ) | [private] |
virtual unsigned lat::DecompressInputStream::checksum | ( | void | ) | const [virtual] |
virtual IOSize lat::DecompressInputStream::fill | ( | void * | buffer, | |
IOSize | length | |||
) | [protected, virtual] |
Reimplemented in lat::ZipInputStream.
DecompressInputStream& lat::DecompressInputStream::operator= | ( | const DecompressInputStream & | ) | [private] |
Reimplemented from lat::FilterInputStream.
Reimplemented in lat::GZIPInputStream, and lat::ZipInputStream.
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.