# new IntArray(data)
Create an empty IntArray. IntArrays can be used to very fast store a large number of integer values. They are supported mainly for File/Zip/Socket IO.
Parameters:
Name | Type | Description |
---|---|---|
data |
Array.<number> | Array.<string> | string | numbers will be used as given, string arrays will be intepreted as "characters" and only the first char is added to the IntArray. Strings will be added char by char. |
Members
Methods
# Append(data)
append the contents of the Javascript array to the IntArray.
Parameters:
Name | Type | Description |
---|---|---|
data |
Array.<number> | Array.<string> | numbers will be used as given, string arrays will be intepreted as "characters" and only the first char is added to the IntArray. Strings will be added char by char. |
# Get(idx) → {number}
get value from specific index.
Parameters:
Name | Type | Description |
---|---|---|
idx |
number | the indext to retrieve. |
the store value.
# Pop() → {number}
retrieve and remove the last value in the IntArray.
the former last value.
# Set(idx, val)
replace value at the given index.
Parameters:
Name | Type | Description |
---|---|---|
idx |
number | the indext to change. |
val |
number | the new value. |
# Shift() → {number}
retrieve and remove the first value in the IntArray.
the former first value.
# ToArray() → {Array.<number>}
convert IntArray to Javascript array.
the contents of the IntArray as Javascript array.
# ToString() → {string}
convert the contents of the IntArray to a string.This simply interpretes each number in the IntArray as an ASCII character(no filtering of NULL bytes or non printable characters and no UTF - 8 conversion).
the contents of the IntArray as a string(as far as possible).