Binary is an efficient implemtation of variable length array of bytes.
Constructor
Creates and returns efficient array of bytes. Indexing of
binary always starts from zero.
| Parameters |
dimension -
Length of array as range (e.g. ..100).
data -
Datas to initialize array with
|
Methods
string decodeFrom(
string encoding)
Decodes this binary to string using given character encoding,
throws IOError if binary cannot be mapped
string decodeFrom(
string encoding,
string replacement)
Decodes this binary to string using given character encoding,
unmappable characters are replaced with given string
string decodeFrom(
string encoding,
null ignore)
Decodes this binary to string using given character encoding,
unmappable characters are ignored.
| Throws |
BadParameter -
if given character encoding is unsupported,
or replacement is invalid
IOError -
if some bytes are unmappable and no replacement given
|
Converts contents of this binary to hexadecimal representation.
Converts the contents of binary at given offset to integer
of given byte width. If width is negative the byteorder
is reversed. Maximum width is eight (8).
If offset is omitted zero (0) is used instead.
Unserializes the serialized data contained in this binary.
| Throws |
CorruptedSerialization -
If serialization is corrupted
|