Class ByteCollection
A collection of bytes.
Inheritance
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class ByteCollection : object
Constructors
ByteCollection()
Initializes a new instance of the ByteCollection class.
Declaration
public ByteCollection()
ByteCollection(Byte[])
Initializes a new instance of the ByteCollection class.
Declaration
public ByteCollection(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The bytes to use as initial data. |
Properties
Count
Gets the number of bytes in the collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Add(Byte)
Adds a byte to the collection.
Declaration
public void Add(byte b)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | b | The byte to add. |
AddRange(ByteCollection)
Adds a byte collection to this collection.
Declaration
public void AddRange(ByteCollection collection)
Parameters
Type | Name | Description |
---|---|---|
ByteCollection | collection | The byte collection to add. |
AddRange(Byte[])
Adds a range of bytes to the collection.
Declaration
public void AddRange(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The range of bytes to add. |
Get(Int32)
Gets a byte from the collection.
Declaration
public byte Get(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to get. |
Returns
Type | Description |
---|---|
System.Byte |
GetRange(Int32, Int32)
Gets a range of bytes from the collection.
Declaration
public byte[] GetRange(int index, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to start getting. |
System.Int32 | count | The number of bytes to get. |
Returns
Type | Description |
---|---|
System.Byte[] |
InsertRange(Int32, ByteCollection)
Inserts a byte collection into this collection.
Declaration
public void InsertRange(int index, ByteCollection collection)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to start adding. |
ByteCollection | collection | The byte collection to insert. |
InsertRange(Int32, Byte[])
Inserts a range of bytes into the collection.
Declaration
public void InsertRange(int index, byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to start adding. |
System.Byte[] | buffer | The range of bytes to insert. |
RemoveRange(Int32, Int32)
Removes a range of bytes from the collection.
Declaration
public void RemoveRange(int index, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to start removing. |
System.Int32 | count | The number of bytes to remove. |
ToArray()
Converts this collection to an array.
Declaration
public byte[] ToArray()
Returns
Type | Description |
---|---|
System.Byte[] |