class EE::System::IOStreamInflate¶
Overview¶
Implementation of a inflating stream. More…
#include <iostreaminflate.hpp> class IOStreamInflate: public EE::System::IOStream { public: // construction IOStreamInflate(IOStream& inOutStream, Compression::Mode mode); virtual ~IOStreamInflate(); // methods static IOStreamInflate* New(IOStream& inOutStream, Compression::Mode mode); virtual ios_size read(char* data, ios_size size); virtual ios_size write(const char* data, ios_size size); virtual ios_size seek(ios_size position); virtual ios_size tell(); virtual ios_size getSize(); virtual bool isOpen(); const Compression::Mode& getMode() const; bool isComplete() const; bool hasError() const; bool hasInput() const; };
Inherited Members¶
public: // methods virtual ios_size read(char* data, ios_size size) = 0; virtual ios_size write(const char* data, ios_size size) = 0; virtual ios_size seek(ios_size position) = 0; virtual ios_size tell() = 0; virtual ios_size getSize() = 0; virtual bool isOpen() = 0;
Detailed Documentation¶
Implementation of a inflating stream.
Construction¶
IOStreamInflate(IOStream& inOutStream, Compression::Mode mode)
Use a stream as a input or output buffer.
Parameters:
inOutStream |
Stream where the results will ve loaded or saved. It must be used only for reading or writing, can’t mix both calls. |
mode |
Compression/Decompression method used |
Methods¶
virtual ios_size read(char* data, ios_size size)
Read data from the stream.
Parameters:
data |
Buffer where to copy the read data |
size |
Desired number of bytes to read |
Returns:
The number of bytes actually read
virtual ios_size write(const char* data, ios_size size)
Write data to the virtual file.
Parameters:
data |
Data to write in the file |
size |
Size of the data that needs to be written |
virtual ios_size seek(ios_size position)
Change the current reading position.
Parameters:
position |
The position to seek to, from the beginning |
Returns:
The position actually sought to.
virtual ios_size tell()
Get the current reading position in the stream.
Returns:
The current position, or -1 on error.
virtual ios_size getSize()
Return the size of the stream.
Returns:
The total number of bytes available in the stream
virtual bool isOpen()
Returns:
If the virtual stream file is open
bool isComplete() const
True after write() has consumed and validated the compressed stream’s end marker.
bool hasInput() const
True once write() has received any compressed bytes. An empty input never completes.