fm.liveswitch.DataBufferStream Class Reference

A data buffer stream. More...

Public Member Functions

 DataBufferStream (fm.liveswitch.DataBuffer buffer)
 Initializes a new instance of the fm.liveswitch.DataBufferStream class. More...
 
 DataBufferStream (int dataBufferSize)
 Initializes a new instance of the fm.liveswitch.DataBufferStream class. More...
 
 DataBufferStream (int dataBufferSize, boolean littleEndian)
 Initializes a new instance of the fm.liveswitch.DataBufferStream class. More...
 
int getAvailable ()
 Gets the available bytes to be read from the DataBuffer. More...
 
byte getBitPosition ()
 Gets the bit position within a byte. More...
 
fm.liveswitch.DataBuffer getBuffer ()
 Gets the buffer. More...
 
int getLength ()
 Gets the buffer length. More...
 
int getPosition ()
 Gets the position within the stream. More...
 
void nextByte ()
 Resets the bit count to 0 and advances to the next byte. More...
 
int peek ()
 Reads an 8-bit value from the DataBuffer without advancing the Position. More...
 
fm.liveswitch.DataBuffer read (int length)
 Reads the specified length from the DataBuffer and advances the position by the length. More...
 
boolean read1 ()
 Read a single bit and advance the bit position by 1. More...
 
int read15 ()
 Reads an 15-bit value from the DataBuffer and advances the Position by 1 and the BitPosition by 7. More...
 
int read16 ()
 Reads an 16-bit value from the DataBuffer and advances the Position by 2. More...
 
int read2 ()
 Read a 2-bit value and advance the BitPosition by 2. More...
 
int read24 ()
 Reads an 24-bit value from the DataBuffer and advances the Position by 3. More...
 
int read3 ()
 Read a 3-bit value and advance the BitPosition by 3. More...
 
long read32 ()
 Reads an 32-bit value from the DataBuffer and advances the Position by 4. More...
 
int read4 ()
 Read a 4-bit value and advance the BitPosition by 4. More...
 
long read40 ()
 Reads an 40-bit value from the DataBuffer and advances the Position by 5. More...
 
long read48 ()
 Reads an 48-bit value from the DataBuffer and advances the Position by 6. More...
 
long read56 ()
 Reads an 56-bit value from the DataBuffer and advances the Position by 7. More...
 
long read64 ()
 Reads an 64-bit value from the DataBuffer and advances the Position by 8. More...
 
int read7 ()
 Reads an 7-bit value from the DataBuffer and advances the BitPosition by 7. More...
 
int read8 ()
 Reads an 8-bit value from the DataBuffer and advances the Position by 1. More...
 
int readByte ()
 Reads a single byte from the stream and advances the Position by 1. More...
 
byte[] readBytes (int length)
 Read a specified number of bytes from the DataBuffer and advance the Position by that number. More...
 
void setBitPosition (byte value)
 Sets the bit position within a byte. More...
 
void setPosition (int value)
 Sets the position within the stream. More...
 
fm.liveswitch.DataBufferStream write (fm.liveswitch.DataBuffer buffer)
 Writes the specified buffer to the DataBuffer and advances the Position by the length of the buffer. More...
 
fm.liveswitch.DataBufferStream write16 (int value)
 Writes an 16-bit value to the DataBuffer and advances the Position by 2. More...
 
fm.liveswitch.DataBufferStream write32 (long value)
 Writes an 32-bit value to the DataBuffer and advances the Position by 4. More...
 
fm.liveswitch.DataBufferStream write64 (long value)
 Writes an 64-bit value to the DataBuffer and advances the Position by 8. More...
 
fm.liveswitch.DataBufferStream write8 (int value)
 Writes an 8-bit value to the DataBuffer and advances the Position by 1. More...
 
fm.liveswitch.DataBufferStream writeBytes (byte[] data)
 Writes the specified data to the DataBuffer and advances the Position by the length of the data. More...
 
fm.liveswitch.DataBufferStream writeBytes (byte[] data, int index, int length)
 Writes the specified data to the DataBuffer and advances the Position by the length. More...
 

Detailed Description

A data buffer stream.

Constructor & Destructor Documentation

◆ DataBufferStream() [1/3]

fm.liveswitch.DataBufferStream.DataBufferStream ( fm.liveswitch.DataBuffer  buffer)

Initializes a new instance of the fm.liveswitch.DataBufferStream class.

Parameters
bufferThe buffer.

◆ DataBufferStream() [2/3]

fm.liveswitch.DataBufferStream.DataBufferStream ( int  dataBufferSize)

Initializes a new instance of the fm.liveswitch.DataBufferStream class.

Parameters
dataBufferSizeSize of the data buffer.

◆ DataBufferStream() [3/3]

fm.liveswitch.DataBufferStream.DataBufferStream ( int  dataBufferSize,
boolean  littleEndian 
)

Initializes a new instance of the fm.liveswitch.DataBufferStream class.

Parameters
dataBufferSizeSize of the data buffer.
littleEndianWhether the data is little-endian.

Member Function Documentation

◆ getAvailable()

int fm.liveswitch.DataBufferStream.getAvailable ( )

Gets the available bytes to be read from the DataBuffer.

◆ getBitPosition()

byte fm.liveswitch.DataBufferStream.getBitPosition ( )

Gets the bit position within a byte.

◆ getBuffer()

fm.liveswitch.DataBuffer fm.liveswitch.DataBufferStream.getBuffer ( )

Gets the buffer.

◆ getLength()

int fm.liveswitch.DataBufferStream.getLength ( )

Gets the buffer length.

◆ getPosition()

int fm.liveswitch.DataBufferStream.getPosition ( )

Gets the position within the stream.

◆ nextByte()

void fm.liveswitch.DataBufferStream.nextByte ( )

Resets the bit count to 0 and advances to the next byte.

◆ peek()

int fm.liveswitch.DataBufferStream.peek ( )

Reads an 8-bit value from the DataBuffer without advancing the Position.

◆ read()

fm.liveswitch.DataBuffer fm.liveswitch.DataBufferStream.read ( int  length)

Reads the specified length from the DataBuffer and advances the position by the length.

Parameters
lengthThe length.

◆ read1()

boolean fm.liveswitch.DataBufferStream.read1 ( )

Read a single bit and advance the bit position by 1.

◆ read15()

int fm.liveswitch.DataBufferStream.read15 ( )

Reads an 15-bit value from the DataBuffer and advances the Position by 1 and the BitPosition by 7.

◆ read16()

int fm.liveswitch.DataBufferStream.read16 ( )

Reads an 16-bit value from the DataBuffer and advances the Position by 2.

◆ read2()

int fm.liveswitch.DataBufferStream.read2 ( )

Read a 2-bit value and advance the BitPosition by 2.

◆ read24()

int fm.liveswitch.DataBufferStream.read24 ( )

Reads an 24-bit value from the DataBuffer and advances the Position by 3.

◆ read3()

int fm.liveswitch.DataBufferStream.read3 ( )

Read a 3-bit value and advance the BitPosition by 3.

◆ read32()

long fm.liveswitch.DataBufferStream.read32 ( )

Reads an 32-bit value from the DataBuffer and advances the Position by 4.

◆ read4()

int fm.liveswitch.DataBufferStream.read4 ( )

Read a 4-bit value and advance the BitPosition by 4.

◆ read40()

long fm.liveswitch.DataBufferStream.read40 ( )

Reads an 40-bit value from the DataBuffer and advances the Position by 5.

◆ read48()

long fm.liveswitch.DataBufferStream.read48 ( )

Reads an 48-bit value from the DataBuffer and advances the Position by 6.

◆ read56()

long fm.liveswitch.DataBufferStream.read56 ( )

Reads an 56-bit value from the DataBuffer and advances the Position by 7.

◆ read64()

long fm.liveswitch.DataBufferStream.read64 ( )

Reads an 64-bit value from the DataBuffer and advances the Position by 8.

◆ read7()

int fm.liveswitch.DataBufferStream.read7 ( )

Reads an 7-bit value from the DataBuffer and advances the BitPosition by 7.

◆ read8()

int fm.liveswitch.DataBufferStream.read8 ( )

Reads an 8-bit value from the DataBuffer and advances the Position by 1.

◆ readByte()

int fm.liveswitch.DataBufferStream.readByte ( )

Reads a single byte from the stream and advances the Position by 1.

◆ readBytes()

byte [] fm.liveswitch.DataBufferStream.readBytes ( int  length)

Read a specified number of bytes from the DataBuffer and advance the Position by that number.

Parameters
lengthThe number of bytes to read.

◆ setBitPosition()

void fm.liveswitch.DataBufferStream.setBitPosition ( byte  value)

Sets the bit position within a byte.

◆ setPosition()

void fm.liveswitch.DataBufferStream.setPosition ( int  value)

Sets the position within the stream.

◆ write()

fm.liveswitch.DataBufferStream fm.liveswitch.DataBufferStream.write ( fm.liveswitch.DataBuffer  buffer)

Writes the specified buffer to the DataBuffer and advances the Position by the length of the buffer.

Parameters
bufferThe buffer.

◆ write16()

fm.liveswitch.DataBufferStream fm.liveswitch.DataBufferStream.write16 ( int  value)

Writes an 16-bit value to the DataBuffer and advances the Position by 2.

Parameters
valueThe value.

◆ write32()

fm.liveswitch.DataBufferStream fm.liveswitch.DataBufferStream.write32 ( long  value)

Writes an 32-bit value to the DataBuffer and advances the Position by 4.

Parameters
valueThe value.

◆ write64()

fm.liveswitch.DataBufferStream fm.liveswitch.DataBufferStream.write64 ( long  value)

Writes an 64-bit value to the DataBuffer and advances the Position by 8.

Parameters
valueThe value.

◆ write8()

fm.liveswitch.DataBufferStream fm.liveswitch.DataBufferStream.write8 ( int  value)

Writes an 8-bit value to the DataBuffer and advances the Position by 1.

Parameters
valueThe value.

◆ writeBytes() [1/2]

fm.liveswitch.DataBufferStream fm.liveswitch.DataBufferStream.writeBytes ( byte[]  data)

Writes the specified data to the DataBuffer and advances the Position by the length of the data.

Parameters
dataThe data.

◆ writeBytes() [2/2]

fm.liveswitch.DataBufferStream fm.liveswitch.DataBufferStream.writeBytes ( byte[]  data,
int  index,
int  length 
)

Writes the specified data to the DataBuffer and advances the Position by the length.

Parameters
dataThe data.
indexThe index.
lengthThe length.