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

BZip2 inflater. More...

#include <base/compression/BZip2Inflater.h>

Inherits Object, and Inflater.

Public Member Functions

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

Static Public Attributes

static constexpr unsigned int BUFFER_SIZE = 64 * 1024
 

Detailed Description

BZip2 inflater.

BZip2 inflater push stream.

Version
1.0

Constructor & Destructor Documentation

◆ BZip2Inflater()

BZip2Inflater::BZip2Inflater ( )

Initializes the inflater.

◆ ~BZip2Inflater()

virtual BZip2Inflater::~BZip2Inflater ( )
virtualnoexcept

Destroys the inflater.

Member Function Documentation

◆ atEnd()

bool BZip2Inflater::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 BZip2Inflater::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 BZip2Inflater::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 BZip2Inflater::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

constexpr unsigned int BZip2Inflater::BUFFER_SIZE = 64 * 1024
staticconstexpr

The size of the decompression buffer.