Base Framework
Public Member Functions | Static Public Attributes | List of all members
ZLibInflater Class Reference

ZLIB inflater. More...

#include <base/compression/ZLibInflater.h>

Inherits Object, and Inflater.

Public Member Functions

 ZLibInflater ()
 
bool atEnd () const noexcept
 
MemorySize push (const uint8 *buffer, MemorySize size)
 
void pushEnd ()
 
MemorySize pull (uint8 *buffer, MemorySize size)
 
virtual ~ZLibInflater () noexcept
 
- Public Member Functions inherited from PushInterface
virtual void flush ()
 
virtual bool pushBegin (uint64 totalSize)
 

Static Public Attributes

static const unsigned int BUFFER_SIZE = 64 * 1024
 

Detailed Description

ZLIB inflater.

ZLIB inflater push stream.

Version
1.0

Constructor & Destructor Documentation

◆ ZLibInflater()

ZLibInflater::ZLibInflater ( )

Initializes the inflater.

◆ ~ZLibInflater()

virtual ZLibInflater::~ZLibInflater ( )
virtualnoexcept

Destroys the inflater.

Member Function Documentation

◆ atEnd()

bool ZLibInflater::atEnd ( ) const
inlinevirtualnoexcept

Returns true if the end has been reached. This may return true before pushEnd() has been invoked if the compressed data has been padded with garbage.

Implements Inflater.

◆ pull()

MemorySize ZLibInflater::pull ( uint8 *  buffer,
MemorySize  size 
)
virtual

Pulls decompressed data from the stream. EndOfFile is raised if atEnd() would return true.

Parameters
bufferThe buffer to receive the data.
sizeThe size of the buffer.
Returns
The number of bytes pulled.

Implements PullInterface.

◆ push()

MemorySize ZLibInflater::push ( const uint8 *  buffer,
MemorySize  size 
)
virtual

Pushes compressed data onto the stream. This method may return 0 if the internal buffer is full. EndOfFile is raised if the end has been reached. IOException is raised unless the inflater is in the normal decompression mode.

Parameters
bufferThe data to be pushed onto the stream.
sizeThe size of the buffer.
Returns
The number of bytes pushed.

Implements PushInterface.

◆ pushEnd()

void ZLibInflater::pushEnd ( )
virtual

This method should be invoked when all compressed data has been pushed onto the stream. Do not invoke push() or pushEnd() hereafter.

Reimplemented from PushInterface.

Member Data Documentation

◆ BUFFER_SIZE

const unsigned int ZLibInflater::BUFFER_SIZE = 64 * 1024
static

The size of the decompression buffer.