KS.Reactor.ksBitReader Class Reference

Reads bit-packed data from a ksStreamBuffer that was written using a ksBitWriter. More...

Public Member Functions

 ksBitReader (ksStreamBuffer buffer)
 Constructor More...
 
uint ReadBits (int bits)
 Reads up to 32 bits from the buffer. More...
 
ulong ReadBits64 (int bits)
 Reads up to 64 bits from the buffer. More...
 
bool ReadBool ()
 Reads 1 bit from the buffer. More...
 
void Align ()
 Advances the position to the next byte if the position is not at a byte boundary. More...
 

Detailed Description

Reads bit-packed data from a ksStreamBuffer that was written using a ksBitWriter.

Constructor & Destructor Documentation

◆ ksBitReader()

KS.Reactor.ksBitReader.ksBitReader ( ksStreamBuffer  buffer)

Constructor

Parameters
bufferBuffer to read from.

Member Function Documentation

◆ Align()

void KS.Reactor.ksBitReader.Align ( )

Advances the position to the next byte if the position is not at a byte boundary.

◆ ReadBits()

uint KS.Reactor.ksBitReader.ReadBits ( int  bits)

Reads up to 32 bits from the buffer.

Parameters
bitsNumber of bits to read.
Returns
Value

◆ ReadBits64()

ulong KS.Reactor.ksBitReader.ReadBits64 ( int  bits)

Reads up to 64 bits from the buffer.

Parameters
bitsNumber of bits to read.
Returns
Value

◆ ReadBool()

bool KS.Reactor.ksBitReader.ReadBool ( )

Reads 1 bit from the buffer.

Returns
True if the bit was 1.