28#ifndef __OGRE_DEFLATE_H__
29#define __OGRE_DEFLATE_H__
112 size_t read(
void* buf,
size_t count);
116 size_t write(
const void* buf,
size_t count);
struct z_stream_s z_stream
General purpose class used for encapsulating the reading and writing of data.
Stream which compresses / uncompresses data using the 'deflate' compression algorithm.
DataStreamPtr mCompressedStream
DataStreamPtr mTmpWriteStream
size_t getAvailInForSinglePass()
unsigned char * mTmp
Intermediate buffer for read / write.
DeflateStream(const DataStreamPtr &compressedStream, const String &tmpFileName="", size_t avail_in=0)
Constructor for creating unnamed stream wrapping another stream.
bool mIsCompressedValid
Whether the underlying stream is valid compressed data.
StaticCache< 16 *OGRE_STREAM_TEMP_SIZE > mReadCache
Cache for read data in case skipping around.
size_t tell(void) const
Returns the current byte offset from beginning.
bool isCompressedStreamValid() const
Returns whether the compressed stream is valid deflated data.
bool eof(void) const
Returns true if the stream has reached the end.
DeflateStream(const String &name, const DataStreamPtr &compressedStream, const String &tmpFileName="", size_t avail_in=0)
Constructor for creating named stream wrapping another stream.
size_t read(void *buf, size_t count)
Read the requisite number of bytes from the stream, stopping at the end of the file.
size_t write(const void *buf, size_t count)
Write the requisite number of bytes from the stream (only applicable to streams that are not read-onl...
void seek(size_t pos)
Repositions the read point to a specified byte.
void skip(long count)
Skip a defined number of bytes.
void close(void)
Close the stream; this makes further operations invalid.