Hunny Software Library Reference

ByteString.ToByteArray Method (Int32, Int32)

Copies the bytes in a specified substring in this instance to a byte array

[Visual Basic]
Overloads Public Function ToByteArray( _
   ByVal startIndex As Integer, _
   ByVal length As Integer _
) As Byte()
[C#]
public byte[] ToByteArray(
   int startIndex,
   int length
);

Parameters

startIndex
The starting position of a substring in this instance
length
The length of the substring in this instance

Return Value

A byte array whose elements are the length number of bytes in this instance starting from position startIndex.

Exceptions

Exception TypeCondition
ArgumentOutOfRangeExceptionstartIndex < 0
- or -
length < 0
- or -
startIndex + length > Length

See Also

ByteString Class | Hunny.Base Namespace | ByteString.ToByteArray Overload List