Class ByteCollection
Represents a collection of bytes.
Inherited Members
Namespace: Be.Windows.Forms
Assembly: Be.Windows.Forms.HexBox.dll
Syntax
public class ByteCollection : CollectionBase, IList, ICollection, IEnumerable
Constructors
View SourceByteCollection()
Initializes a new instance of ByteCollection class.
Declaration
public ByteCollection()
ByteCollection(byte[])
Initializes a new instance of ByteCollection class.
Declaration
public ByteCollection(byte[] bs)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bs | an array of bytes to add to collection |
Properties
View Sourcethis[int]
Gets or sets the value of a byte
Declaration
public byte this[int index] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
Property Value
| Type | Description |
|---|---|
| byte |
Methods
View SourceAdd(byte)
Adds a byte into the collection.
Declaration
public void Add(byte b)
Parameters
| Type | Name | Description |
|---|---|---|
| byte | b | the byte to add |
AddRange(byte[])
Adds a range of bytes to the collection.
Declaration
public void AddRange(byte[] bs)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bs | the bytes to add |
Contains(byte)
Returns true, if the byte exists in the collection.
Declaration
public bool Contains(byte b)
Parameters
| Type | Name | Description |
|---|---|---|
| byte | b |
Returns
| Type | Description |
|---|---|
| bool |
CopyTo(byte[], int)
Copies the content of the collection into the given array.
Declaration
public void CopyTo(byte[] bs, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bs | |
| int | index |
GetBytes()
Gets all bytes in the array
Declaration
public byte[] GetBytes()
Returns
| Type | Description |
|---|---|
| byte[] | an array of bytes. |
IndexOf(byte)
Returns the index of the given byte.
Declaration
public int IndexOf(byte b)
Parameters
| Type | Name | Description |
|---|---|---|
| byte | b |
Returns
| Type | Description |
|---|---|
| int |
Insert(int, byte)
Inserts a byte to the collection.
Declaration
public void Insert(int index, byte b)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | the index |
| byte | b | a byte to insert |
InsertRange(int, byte[])
Inserts a range of bytes to the collection.
Declaration
public void InsertRange(int index, byte[] bs)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | the index of start byte |
| byte[] | bs | an array of bytes to insert |
Remove(byte)
Removes a byte from the collection.
Declaration
public void Remove(byte b)
Parameters
| Type | Name | Description |
|---|---|---|
| byte | b | the byte to remove |
RemoveRange(int, int)
Removes a range of bytes from the collection.
Declaration
public void RemoveRange(int index, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | the index of the start byte |
| int | count | the count of the bytes to remove |
ToArray()
Copies the content of the collection into an array.
Declaration
public byte[] ToArray()
Returns
| Type | Description |
|---|---|
| byte[] | the array containing all bytes. |