DWFCore::DWFCompressingInputStream Class Reference

#include "dwfcore/DWFCompressingInputStream.h"

Inheritance diagram for DWFCore::DWFCompressingInputStream:

Inheritance graph
[legend]
Collaboration diagram for DWFCore::DWFCompressingInputStream:

Collaboration graph
[legend]
List of all members.

Detailed Description

An input stream object that uses zlib to decompress bytes from from another stream.

Since:
1.0.1
This implementation of the DWFInputStream is used to provide to zlib deflate for compressed bytes sourced by another input stream.

Definition at line 69 of file DWFCompressingInputStream.h.

Public Member Functions

_DWFCORE_API DWFCompressingInputStream (DWFInputStream *pInputStream, DWFZipFileDescriptor::teFileMode fileMode, bool bOwnStream) throw ()
virtual _DWFCORE_API ~DWFCompressingInputStream () throw ()
_DWFCORE_API size_t available () const throw ( DWFException )
_DWFCORE_API size_t read (void *pBuffer, size_t nBytesToRead) throw ( DWFException )
_DWFCORE_API off_t seek (int eOrigin, off_t nOffset) throw ( DWFException )


Constructor & Destructor Documentation

_DWFCORE_API DWFCore::DWFCompressingInputStream::DWFCompressingInputStream DWFInputStream pInputStream,
DWFZipFileDescriptor::teFileMode  fileMode,
bool  bOwnStream
throw ()
 

Constructor

Parameters:
pInputStream An input stream from which to stream the decompressed source data. This object should be allocated with the DWFCORE_ALLOC_OBJECT macro if ownership will be transferred.
bOwnStream If true, this object will assume ownership of pInputStream and delete it as necessary using DWFCORE_FREE_OBJECT. If false, the caller retains ownership of pInputStream and is responsible for deleting it.
Exceptions:
None 

virtual _DWFCORE_API DWFCore::DWFCompressingInputStream::~DWFCompressingInputStream  )  throw () [virtual]
 

Destructor

Exceptions:
None 


Member Function Documentation

_DWFCORE_API size_t DWFCore::DWFCompressingInputStream::available  )  const throw ( DWFException ) [virtual]
 

Used to determine the availablity of data remaining in the stream. The byte count returned by this method will report either the number of inflated bytes left in the overrun buffer or if that buffer is empty, the number of uncompressed bytes remaining in the underlying source stream. Regardless of the source, if zero bytes are returned as available, the stream is exhuasted and thus, fully compressed.

Returns:
The number of bytes available to read from the stream.
Exceptions:
DWFException 

Implements DWFCore::DWFInputStream.

_DWFCORE_API size_t DWFCore::DWFCompressingInputStream::read void *  pBuffer,
size_t  nBytesToRead
throw ( DWFException ) [virtual]
 

Reads at most nBytesToRead compressed bytes from into the buffer provided. If the overrun buffer contains inflated data, these will be copied into pBuffer. This buffer will always be exhausted prior to subsequent deflation of the uncompressed stream data, even if nBytesToRead is larger than the number of inflated bytes in the overrun buffer. If the overrun buffer is empty, at most nBytesToRead bytes will be decompressed from the underlying stream. The stream is not required to fill the read buffer but it must always report the number of bytes, including zero, that were obtained.

Parameters:
pBuffer A pointer to a block of memory to receive the bytes.
nBytesToRead The number of bytes to copy into pBuffer. This value should not exceed the capacity of the memory block at pBuffer.
Returns:
The number of compressed bytes read into pBuffer.
Exceptions:
DWFException 

Implements DWFCore::DWFInputStream.

_DWFCORE_API off_t DWFCore::DWFCompressingInputStream::seek int  eOrigin,
off_t  nOffset
throw ( DWFException ) [virtual]
 

Warning:
This method is not implemented and will always throw an exception if invoked.
Parameters:
eOrigin One of SEEK_SET, SEEK_CUR or SEEK_END.
nOffset The number of bytes from eOrigin to move the internal cursor.
Returns:
The previous cursor offset before the seek.
Exceptions:
DWFException 

Implements DWFCore::DWFInputStream.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:39:35 2009 for Autodesk DWF Core Library by  doxygen 1.4.5