Foxit PDF SDK
CFX_BitStream Class Reference

Inherits CFX_Object.

Public Member Functions

void ByteAlign ()
 Get to byte boundary. If current bit position is not multiplication of 8, the rest of the current byte will be skipped. More...
 
FX_DWORD GetBits (FX_DWORD nBits)
 Get specified number of bits (maximum 32 bits). More...
 
void Init (FX_LPCBYTE pData, FX_DWORD dwSize)
 Initialize the bit-stream with a memory block. Must call Init() first. More...
 
FX_BOOL IsEOF () const
 Check if reached end of the stream. More...
 
void Rewind ()
 Rewind a bit-stream. Simply set the current bit position to be zero. More...
 
void SkipBits (FX_DWORD nBits)
 Skip a number of bits. More...
 

Detailed Description

The class represents Bit stream, reading from a continuous bit stream (starting at byte boundary). Assuming number of bits in each unit is not larger than 32.

Member Function Documentation

◆ ByteAlign()

void CFX_BitStream::ByteAlign ( )

Get to byte boundary. If current bit position is not multiplication of 8, the rest of the current byte will be skipped.

Returns
None.

◆ GetBits()

FX_DWORD CFX_BitStream::GetBits ( FX_DWORD  nBits)

Get specified number of bits (maximum 32 bits).

Parameters
[in]nBitsSpecify the number of bits (maximum 32 bits).
Returns
A FX_DWORD value.

◆ Init()

void CFX_BitStream::Init ( FX_LPCBYTE  pData,
FX_DWORD  dwSize 
)

Initialize the bit-stream with a memory block. Must call Init() first.

Parameters
[in]pDataPointer to a memory block.
[in]dwSizeThe size in bytes of the memory block.
Returns
None.

◆ IsEOF()

FX_BOOL CFX_BitStream::IsEOF ( ) const
inline

Check if reached end of the stream.

Returns
true means it reached end of the stream, while false means not.

◆ Rewind()

void CFX_BitStream::Rewind ( )
inline

Rewind a bit-stream. Simply set the current bit position to be zero.

Returns
None.

◆ SkipBits()

void CFX_BitStream::SkipBits ( FX_DWORD  nBits)
inline

Skip a number of bits.

Parameters
[in]nBitsThe number of bits to be skipped.
Returns
None.