copyByteArray
Createsa full or partialcopy of a byte array.
Syntax
ogscript.copyByteArray(src, offset, length)
Parameters
Parameter |
Type |
Required |
Description |
src |
byte array |
Yes |
The byte array to be copied. |
offset |
Integer |
Yes |
Index of the first byte to be copied. Use 0 for the start of the array. |
length |
Integer |
Yes |
The number of bytes to copy. Tip: To copy the entire array, use src.length. |
Returns
byte array
Example 1
In the following example, the contentsof a byte array named srcArray are copied into a variablenamed myCopy.
var myCopy=ogscript.copyByteArray (srcArray,0,srcArray.length);
Example 2
In the followingexample, the 20 bytes of a byte array named srcArray, starting at byte 4, are copied into a variablenamed myCopy.
var myCopy=ogscript.copyByteArray (srcArray,4,20);