Link Search Menu Expand Document

ByteArray constructor

Explanation Initialize the ByteArray object.

If no argument is specified, it will be initialized empty.
Multiple values can be specified for the argument, and the specified values are combined and initialized.
Call format var barr = new ByteArray ([data_1 [, data_2 , [, ... [, data_n ]]]])
Return value ByteArray object
Arguments data_n Specify the data to be set as the default value.
You can specify strings, ByteArray objects, and binary data. Otherwise, it will be converted to a string.The following specifications have been added to Mobile, Ver.5.0.0, AI Ver.1.0.1

If a positive integer is passed as an argument, it will be stored as binary data as it is. This makes it possible to create non-character data strings such as control codes.
Numerical values are stored in little endian as 1 byte from 0 to 255, 2 bytes from 256 to 65535, and 4 bytes from 65536 to 4294967295 (hexadecimal FFFFFFFF).
Numerical values outside the above range and numerical values including decimal numbers are stored as character strings.
Exception None
Example of use
var b1 = new ByteArray(file.Read());
var b2 = new ByteArray("sample", "test");
var b3 = new ByteArray(response.Read());
Related item