SerialBuffer
Extends
Uint8Array
Indexable
[index
: number
]: number
Constructors
new SerialBuffer()
Parameter | Type |
---|---|
First | number |
Returns |
---|
SerialBuffer |
Overrides
Uint8Array.constructor
new SerialBuffer()
Parameter | Type |
---|---|
First | ArrayBuffer | ArrayLike <number > |
Returns |
---|
SerialBuffer |
Overrides
Uint8Array.constructor
Properties
[toStringTag]
Inherited from
Uint8Array.[toStringTag]
buffer
The ArrayBuffer instance referenced by the array.
Inherited from
Uint8Array.buffer
byteLength
The length in bytes of the array.
Inherited from
Uint8Array.byteLength
byteOffset
The offset in bytes of the array.
Inherited from
Uint8Array.byteOffset
BYTES_PER_ELEMENT
The size in bytes of each element in the array.
Inherited from
Uint8Array.BYTES_PER_ELEMENT
length
The length of the array.
Inherited from
Uint8Array.length
BYTES_PER_ELEMENT
The size in bytes of each element in the array.
Inherited from
Uint8Array.BYTES_PER_ELEMENT
EMPTY
Accessors
readPos
Get Signature
Set Signature
####### value
number
writePos
Get Signature
Set Signature
####### value
number
Methods
[iterator]()
<number
>
Inherited from
Uint8Array.[iterator]
copyWithin()
Returns the this object after copying a section of the array identified by start and end to the same array starting at position target
Parameter | Type |
---|---|
First | number |
If target is negative, it is treated as length+target where length is the | |
length of the array. |
start
number
If start is negative, it is treated as length+start. If end is negative, it is treated as length+end.
end?
number
If not specified, length of the this object is used as its default value.
Inherited from
Uint8Array.copyWithin
entries()
Returns an array of key, value pairs for every entry in the array
<[number
, number
]>
Inherited from
Uint8Array.entries
every()
Determines whether all the members of an array satisfy the specified test.
Parameter | Type |
---|---|
First | ( value, index, array) => unknown`` |
A function that accepts up to three arguments. The every method calls | |
the predicate function for each element in the array until the predicate returns a value | |
which is coercible to the Boolean value false, or until the end of the array. |
thisArg?
any
An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
Inherited from
Uint8Array.every
fill()
Changes all array elements from start
to end
index to a static value
and returns the modified array
Parameter | Type |
---|---|
First | number |
value to fill array section with |
start?
number
index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.
end?
number
index to stop filling the array at. If end is negative, it is treated as length+end.
Inherited from
Uint8Array.fill
filter()
Returns the elements of an array that meet the condition specified in a callback function.
Parameter | Type |
---|---|
First | ( value, index, array) => any`` |
A function that accepts up to three arguments. The filter method calls | |
the predicate function one time for each element in the array. |
thisArg?
any
An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
Inherited from
Uint8Array.filter
find()
Returns the value of the first element in the array where predicate is true, and undefined otherwise.
Parameter | Type |
---|---|
First | ( value, index, obj) => boolean`` |
find calls predicate once for each element of the array, in ascending | |
order, until it finds one where predicate returns true. If such an element is found, find | |
immediately returns that element value. Otherwise, find returns undefined. |
thisArg?
any
If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
Inherited from
Uint8Array.find
findIndex()
Returns the index of the first element in the array where predicate is true, and -1 otherwise.
Parameter | Type |
---|---|
First | ( value, index, obj) => boolean`` |
find calls predicate once for each element of the array, in ascending | |
order, until it finds one where predicate returns true. If such an element is found, | |
findIndex immediately returns that element index. Otherwise, findIndex returns -1. |
thisArg?
any
If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
Inherited from
Uint8Array.findIndex
forEach()
Performs the specified action for each element in an array.
Parameter | Type |
---|---|
First | ( value, index, array) => void`` |
A function that accepts up to three arguments. forEach calls the | |
callbackfn function one time for each element in the array. |
thisArg?
any
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
Inherited from
Uint8Array.forEach
indexOf()
Returns the index of the first occurrence of a value in an array.
Parameter | Type |
---|---|
First | number |
The value to locate in the array. |
fromIndex?
number
The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
Inherited from
Uint8Array.indexOf
join()
Adds all the elements of an array separated by the specified separator string.
Parameter | Type |
---|---|
First | string |
A string used to separate one element of an array from the next in the | |
resulting String. If omitted, the array elements are separated with a comma. |
Inherited from
Uint8Array.join
keys()
Returns an list of keys in the array
<number
>
Inherited from
Uint8Array.keys
lastIndexOf()
Returns the index of the last occurrence of a value in an array.
Parameter | Type |
---|---|
First | number |
The value to locate in the array. |
fromIndex?
number
The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
Inherited from
Uint8Array.lastIndexOf
map()
Calls a defined callback function on each element of an array, and returns an array that contains the results.
Parameter | Type |
---|---|
First | ( value, index, array) => number`` |
A function that accepts up to three arguments. The map method calls the | |
callbackfn function one time for each element in the array. |
thisArg?
any
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
Inherited from
Uint8Array.map
read()
Parameter | Type |
---|---|
First | number |
readFloat64()
readPaddedString()
Parameter | Type |
---|---|
First | number |
readString()
Parameter | Type |
---|---|
First | number |
readUint16()
readUint32()
readUint64()
readUint8()
readVarLengthString()
readVarUint()
reduce()
Call Signature
Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
####### callbackfn
(previousValue
, currentValue
, currentIndex
, array
) => number
A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
Inherited from
Uint8Array.reduce
Call Signature
####### callbackfn
(previousValue
, currentValue
, currentIndex
, array
) => number
initialValue
number
Inherited from
Uint8Array.reduce
Call Signature
Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Type Parameters
• U
####### callbackfn
(previousValue
, currentValue
, currentIndex
, array
) => U
A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
initialValue
U
If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
Inherited from
Uint8Array.reduce
reduceRight()
Call Signature
Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
####### callbackfn
(previousValue
, currentValue
, currentIndex
, array
) => number
A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
Inherited from
Uint8Array.reduceRight
Call Signature
####### callbackfn
(previousValue
, currentValue
, currentIndex
, array
) => number
initialValue
number
Inherited from
Uint8Array.reduceRight
Call Signature
Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Type Parameters
• U
####### callbackfn
(previousValue
, currentValue
, currentIndex
, array
) => U
A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
initialValue
U
If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
Inherited from
Uint8Array.reduceRight
reset()
Resets the read and write position of the buffer to zero.
reverse()
Reverses the elements in an Array.
Inherited from
Uint8Array.reverse
set()
Sets a value or an array of values.
Parameter | Type |
---|---|
First | ArrayLike <number > |
A typed or untyped array of values to set. |
offset?
number
The index in the current array at which the values are to be written.
Inherited from
Uint8Array.set
slice()
Returns a section of an array.
Parameter | Type |
---|---|
First | number |
The beginning of the specified portion of the array. |
end?
number
The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
Inherited from
Uint8Array.slice
some()
Determines whether the specified callback function returns true for any element of an array.
Parameter | Type |
---|---|
First | ( value, index, array) => unknown`` |
A function that accepts up to three arguments. The some method calls | |
the predicate function for each element in the array until the predicate returns a value | |
which is coercible to the Boolean value true, or until the end of the array. |
thisArg?
any
An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
Inherited from
Uint8Array.some
sort()
Sorts an array.
Parameter | Type |
---|---|
First | ( a, b) => number`` |
Function used to determine the order of the elements. It is expected to return | |
a negative value if first argument is less than second argument, zero if they're equal and a positive | |
value otherwise. If omitted, the elements are sorted in ascending order. |
Inherited from
Uint8Array.sort
subarray()
Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive.
Parameter | Type |
---|---|
First | number |
The index of the end of the array. |
Overrides
Uint8Array.subarray
toLocaleString()
Converts a number to a string by using the current locale.
Inherited from
Uint8Array.toLocaleString
toString()
Returns a string representation of an array.
Inherited from
Uint8Array.toString
valueOf()
Returns the primitive value of the specified object.
Inherited from
Uint8Array.valueOf
values()
Returns an list of values in the array
<number
>
Inherited from
Uint8Array.values
write()
Parameter | Type |
---|---|
First | Uint8Array |
writeFloat64()
Parameter | Type |
---|---|
First | number |
writePaddedString()
Parameter | Type |
---|---|
First | number |
writeString()
Parameter | Type |
---|---|
First | number |
writeUint16()
Parameter | Type |
---|---|
First | number |
writeUint32()
Parameter | Type |
---|---|
First | number |
writeUint64()
Parameter | Type |
---|---|
First | number |
writeUint8()
Parameter | Type |
---|---|
First | number |
writeVarLengthString()
Parameter | Type |
---|---|
First | string |
writeVarUint()
Parameter | Type |
---|---|
First | number |
from()
Call Signature
Creates an array from an array-like or iterable object.
####### arrayLike
ArrayLike
<number
>
An array-like or iterable object to convert to an array.
Inherited from
Uint8Array.from
Call Signature
Creates an array from an array-like or iterable object.
Type Parameters
• T
####### arrayLike
ArrayLike
<T
>
An array-like or iterable object to convert to an array.
mapfn
(v
, k
) => number
A mapping function to call on every element of the array.
thisArg?
any
Value of 'this' used to invoke the mapfn.
Inherited from
Uint8Array.from
Call Signature
Creates an array from an array-like or iterable object.
####### arrayLike
Iterable
<number
>
An array-like or iterable object to convert to an array.
mapfn?
(v
, k
) => number
A mapping function to call on every element of the array.
thisArg?
any
Value of 'this' used to invoke the mapfn.
Inherited from
Uint8Array.from
of()
Returns a new array from a set of elements.
Parameter | Type |
---|---|
First | ... number[] |
A set of elements to include in the new array object. |
Inherited from
Uint8Array.of
varLengthStringSize()
Parameter | Type |
---|---|
First | string |
varUintSize()
Parameter | Type |
---|---|
First | number |