Arrays
Function: ArrayToHexString
Description:
Converts a byte array to a hex string representation.
Parameters:
- data: Byte array to convert.
Return Value:
Returns a string representation of the byte array in hexadecimal format.
| Usage Example | |
|---|---|
Function: HexStringToArray
Description:
Converts a hex string to its byte array representation.
Parameters:
- hex: Hexadecimal string to convert.
Return Value:
Returns the corresponding byte array.
| Usage Example | |
|---|---|
Function: ByteArrayToString
Description:
Converts a byte array to its string representation.
Parameters:
- bytes: Byte array to convert.
Return Value:
Returns the string representation of the byte array.
| Usage Example | |
|---|---|
Function: StringToByteArray
Description:
Converts a string to its byte array representation.
Parameters:
- text: String to convert.
Return Value:
Returns the byte array representation of the string.
| Usage Example | |
|---|---|
Function: SubArray
Description:
Extracts a sub-array from the given array starting from the specified offset.
Parameters:
- array: The source array.
- offset: The starting position in the source array.
- count: (Optional) The number of elements to extract. Defaults to 0.
- reverse: (Optional) If set to true, the sub-array is reversed before returning. Defaults to false.
Return Value:
Returns the extracted sub-array.
| Usage Example | |
|---|---|
Function: MergeArrays
Description:
Merges multiple byte arrays into a single array.
Parameters:
- arrs: Arrays to merge.
Return Value:
Returns the merged array.
| Usage Example | |
|---|---|
Procedure: ReverseArray
Description:
Reverses the order of elements in the given byte array.
Parameters:
- arr: Array to reverse.
| Usage Example | |
|---|---|
Function: GenerateFilledArray
Description:
Generates a byte array of the specified length, filled with the given byte value.
Parameters:
- fill: Byte value to fill the array with.
- length: Length of the array to generate.
Return Value:
Returns the generated byte array.
| Usage Example | |
|---|---|
Function: GetInt16FromArray
Description:
Extracts a 16-bit integer from the byte array starting from the specified offset.
Parameters:
- dataBytes: Source byte array.
- offset: Offset from where to start the extraction.
- reverse: (Optional) If set to true, the bytes are reversed before conversion.
Return Value:
Returns the extracted 16-bit integer.
| Usage Example | |
|---|---|
Function: GetUInt16FromArray
Description:
Extracts an unsigned 16-bit integer from the byte array starting from the specified offset.
Parameters:
- dataBytes: Source byte array.
- offset: Offset from where to start the extraction.
- reverse: (Optional) If set to true, the bytes are reversed before conversion.
Return Value:
Returns the extracted unsigned 16-bit integer.
| Usage Example | |
|---|---|
Function: GetInt32FromArray
Description:
Extracts a 32-bit integer from the byte array starting from the specified offset.
Parameters:
- dataBytes: Source byte array.
- offset: Offset from where to start the extraction.
- reverse: (Optional) If set to true, the bytes are reversed before conversion.
Return Value:
Returns the extracted 32-bit integer.
| Usage Example | |
|---|---|
Function: GetUInt32FromArray
Description:
Extracts an unsigned 32-bit integer from the byte array starting from the specified offset.
Parameters:
- dataBytes: Source byte array.
- offset: Offset from where to start the extraction.
- reverse: (Optional) If set to true, the bytes are reversed before conversion.
Return Value:
Returns the extracted unsigned 32-bit integer.
| Usage Example | |
|---|---|
Function: ApplyMaskedValues
Description:
Applies masked values from the value byte array to the target data byte array based on the provided mask byte array.
Parameters:
- dataBytes: Target byte array to which the values will be applied.
- valueBytes: Byte array containing values to apply.
- maskBytes: Mask byte array that dictates which values should be applied.
- offset: (Optional) Starting position in the target data byte array.
Return Value:
Returns true if the values were successfully applied, otherwise false.
| Usage Example | |
|---|---|
Function: ArrayCopy
bool ArrayCopy(byte[] source, int sourceOffset, byte[] destination, int destinationOffset, int count)
Copies a specified number of bytes from a source array starting at a particular offset to a destination array starting at a particular offset.
Parameters:
source(byte[]): The source array from which bytes will be copied.sourceOffset(int): The zero-based byte offset in the source array at which copying begins.destination(byte[]): The destination array into which the bytes will be copied.destinationOffset(int): The zero-based byte offset in the destination array at which storing begins.count(int): The number of bytes to be copied.
Return Value:
Returns true if the operation was successful; otherwise, false.
Example Usage:
To copy 5 bytes from sourceArray starting from offset 2 to destinationArray starting at offset 3:
After the above operation, destinationArray would have its values modified based on the bytes copied from sourceArray.