fm.liveswitch.CircularBuffer Class Reference

A circular buffer. More...

Public Member Functions

 CircularBuffer (int length, int latency)
 Initializes a new instance of the fm.liveswitch.CircularBuffer class. More...
 
 CircularBuffer (int length, int latency, boolean littleEndian)
 Initializes a new instance of the fm.liveswitch.CircularBuffer class. More...
 
int getAvailable ()
 Gets the number of bytes available for reading. More...
 
int getLatency ()
 Gets the latency. More...
 
int getLength ()
 Gets the length. More...
 
boolean getLittleEndian ()
 Gets whether the data is little-endian. More...
 
int getReadOffset ()
 Gets the read offset. More...
 
int getWriteOffset ()
 Gets the read offset. More...
 
fm.liveswitch.DataBuffer read (int length)
 Reads data from the buffer. More...
 
void write (fm.liveswitch.DataBuffer buffer)
 Writes data to the buffer. More...
 

Detailed Description

A circular buffer.

Constructor & Destructor Documentation

◆ CircularBuffer() [1/2]

fm.liveswitch.CircularBuffer.CircularBuffer ( int  length,
int  latency 
)

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

Parameters
lengthThe length.
latencyThe latency.

◆ CircularBuffer() [2/2]

fm.liveswitch.CircularBuffer.CircularBuffer ( int  length,
int  latency,
boolean  littleEndian 
)

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

Parameters
lengthThe length.
latencyThe latency.
littleEndianWhether the data is little-endian.

Member Function Documentation

◆ getAvailable()

int fm.liveswitch.CircularBuffer.getAvailable ( )

Gets the number of bytes available for reading.

◆ getLatency()

int fm.liveswitch.CircularBuffer.getLatency ( )

Gets the latency.

◆ getLength()

int fm.liveswitch.CircularBuffer.getLength ( )

Gets the length.

◆ getLittleEndian()

boolean fm.liveswitch.CircularBuffer.getLittleEndian ( )

Gets whether the data is little-endian.

◆ getReadOffset()

int fm.liveswitch.CircularBuffer.getReadOffset ( )

Gets the read offset.

◆ getWriteOffset()

int fm.liveswitch.CircularBuffer.getWriteOffset ( )

Gets the read offset.

◆ read()

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

Reads data from the buffer.

Parameters
lengthThe number of bytes to read.

◆ write()

void fm.liveswitch.CircularBuffer.write ( fm.liveswitch.DataBuffer  buffer)

Writes data to the buffer.

Parameters
bufferThe data to write.