Robytearray – BrightSign Object Reference Manual (FW 5.1) User Manual
Page 19

11
roByteArray
This object contains functions for converting strings to or from a byte array, as well as to or from ASCII hex or ASCII
base64. Note that if you are converting a byte array to a string, and the byte array contains a zero, the string conversion
will end at that point.
The byte array will automatically resize to become larger as needed. If you wish to disable this behavior, use the
SetResize() method. If an uninitialized index is read, Invalid is returned.
Since roByteArray supports the ifArray interface, it can be accessed with the
array [] operator. The byte array is
always accessed as unsigned bytes while this interface is being used. This object also supports the ifEnum interface, and
so can be used with a
FOR EACH statement.
See
for a description of ifArray, ifArrayGet, ifEnum and ifArraySet.
The ifByteArray interface provides the following:
•
WriteFile(file_path As String) As Boolean: Writes the bytes contained in the byte array to the
specified file. This method returns True if successful.
•
WriteFile(file_path As String, start_index As Integer, length As Integer) As Boolean:
Writes a subset of the bytes contained in the byte array to the specified file. This method writes
length bytes,
beginning at
start_index of the byte array.
•
ReadFile(file_path As String) As Boolean: Reads the specified file into the byte array. This operation
will discard any data currently contained in the byte array.