Web3S_Demo > Web 3S Byte Utils Function Library > Get Bytes Sub Array

Get Bytes Sub Array

Extracts a subarray of bytes from the given array, starting at a specified index and of a specified length.

Inputs

In
Exec

Byte Array
Array of Bytes

The input array from which the subarray will be extracted.

Index
Integer

The starting index for the subarray. Negative values adjust the length accordingly and start from index 0.

Length
Integer

The number of elements to include in the subarray. Defaults to the maximum possible range.

Outputs

Out
Exec

Sub Array
Array of Bytes

The new array containing the specified subarray. If the input array is empty or the length is invalid, returns an empty array.