fm.liveswitch.ByteCollection Class Reference

A collection of bytes. More...

Public Member Functions

void add (byte b)
 Adds a byte to the collection. More...
 
void add (int b)
 Adds a byte to the collection. More...
 
void addRange (byte[] buffer)
 Adds a range of bytes to the collection. More...
 
void addRange (ByteCollection collection)
 Adds a byte collection to this collection. More...
 
 ByteCollection ()
 Initializes a new instance of the fm.liveswitch.ByteCollection class. More...
 
 ByteCollection (byte[] buffer)
 Initializes a new instance of the fm.liveswitch.ByteCollection class. More...
 
byte get (int index)
 Gets a byte from the collection. More...
 
int getCount ()
 Gets the number of bytes in the collection. More...
 
byte[] getRange (int index, int count)
 Gets a range of bytes from the collection. More...
 
void insertRange (int index, byte[] buffer)
 Inserts a range of bytes into the collection. More...
 
void insertRange (int index, ByteCollection collection)
 Inserts a byte collection into this collection. More...
 
void removeRange (int index, int count)
 Removes a range of bytes from the collection. More...
 
byte[] toArray ()
 Converts this collection to an array. More...
 

Detailed Description

A collection of bytes.

Constructor & Destructor Documentation

◆ ByteCollection() [1/2]

fm.liveswitch.ByteCollection.ByteCollection ( )

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

◆ ByteCollection() [2/2]

fm.liveswitch.ByteCollection.ByteCollection ( byte[]  buffer)

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

Parameters
bufferThe bytes to use as initial data.

Member Function Documentation

◆ add() [1/2]

void fm.liveswitch.ByteCollection.add ( byte  b)

Adds a byte to the collection.

Parameters
bThe byte to add.

◆ add() [2/2]

void fm.liveswitch.ByteCollection.add ( int  b)

Adds a byte to the collection.

Parameters
bThe byte to add.

◆ addRange() [1/2]

void fm.liveswitch.ByteCollection.addRange ( byte[]  buffer)

Adds a range of bytes to the collection.

Parameters
bufferThe range of bytes to add.

◆ addRange() [2/2]

void fm.liveswitch.ByteCollection.addRange ( ByteCollection  collection)

Adds a byte collection to this collection.

Parameters
collectionThe byte collection to add.

◆ get()

byte fm.liveswitch.ByteCollection.get ( int  index)

Gets a byte from the collection.

Parameters
indexThe index to get.
Returns

◆ getCount()

int fm.liveswitch.ByteCollection.getCount ( )

Gets the number of bytes in the collection.

◆ getRange()

byte [] fm.liveswitch.ByteCollection.getRange ( int  index,
int  count 
)

Gets a range of bytes from the collection.

Parameters
indexThe index to start getting.
countThe number of bytes to get.
Returns

◆ insertRange() [1/2]

void fm.liveswitch.ByteCollection.insertRange ( int  index,
byte[]  buffer 
)

Inserts a range of bytes into the collection.

Parameters
indexThe index to start adding.
bufferThe range of bytes to insert.

◆ insertRange() [2/2]

void fm.liveswitch.ByteCollection.insertRange ( int  index,
ByteCollection  collection 
)

Inserts a byte collection into this collection.

Parameters
indexThe index to start adding.
collectionThe byte collection to insert.

◆ removeRange()

void fm.liveswitch.ByteCollection.removeRange ( int  index,
int  count 
)

Removes a range of bytes from the collection.

Parameters
indexThe index to start removing.
countThe number of bytes to remove.

◆ toArray()

byte [] fm.liveswitch.ByteCollection.toArray ( )

Converts this collection to an array.

Returns