Classes

SerialBuffer

Extends

  • Uint8Array

Indexable

[index: number]: number

Constructors

new SerialBuffer()

new SerialBuffer(`length`): [SerialBuffer](SerialBuffer)
ParameterType
Firstnumber

Overrides

Uint8Array.constructor

new SerialBuffer()

new SerialBuffer(`array`): [SerialBuffer](SerialBuffer)
ParameterType
FirstArrayBuffer | ArrayLike<number>

Overrides

Uint8Array.constructor

Properties

[toStringTag]

`readonly` \[toStringTag\]: `"Uint8Array"`

Inherited from

Uint8Array.[toStringTag]


buffer

`readonly` buffer: `ArrayBuffer`

The ArrayBuffer instance referenced by the array.

Inherited from

Uint8Array.buffer


byteLength

`readonly` byteLength: `number`

The length in bytes of the array.

Inherited from

Uint8Array.byteLength


byteOffset

`readonly` byteOffset: `number`

The offset in bytes of the array.

Inherited from

Uint8Array.byteOffset


BYTES_PER_ELEMENT

`readonly` BYTES\_PER\_ELEMENT: `number`

The size in bytes of each element in the array.

Inherited from

Uint8Array.BYTES_PER_ELEMENT


length

`readonly` length: `number`

The length of the array.

Inherited from

Uint8Array.length


BYTES_PER_ELEMENT

`readonly` `static` BYTES\_PER\_ELEMENT: `number`

The size in bytes of each element in the array.

Inherited from

Uint8Array.BYTES_PER_ELEMENT


EMPTY

`static` EMPTY: [SerialBuffer](SerialBuffer)

Accessors

readPos

Get Signature

get readPos(): `number`

Set Signature

set readPos(`value`): `void`

####### value

number


writePos

Get Signature

get writePos(): `number`

Set Signature

set writePos(`value`): `void`

####### value

number

Methods

[iterator]()

\[iterator\](): `IterableIterator`\<`number`\>

<number>

Inherited from

Uint8Array.[iterator]


copyWithin()

copyWithin(`target`, `start`, `end`?): `this`

Returns the this object after copying a section of the array identified by start and end to the same array starting at position target

ParameterType
Firstnumber
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()

entries(): `IterableIterator`\<\[`number`, `number`\]\>

Returns an array of key, value pairs for every entry in the array

<[number, number]>

Inherited from

Uint8Array.entries


every()

every(`predicate`, `thisArg`?): `boolean`

Determines whether all the members of an array satisfy the specified test.

ParameterType
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()

fill(`value`, `start`?, `end`?): `this`

Changes all array elements from start to end index to a static value and returns the modified array

ParameterType
Firstnumber
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()

filter(`predicate`, `thisArg`?): `Uint8Array`

Returns the elements of an array that meet the condition specified in a callback function.

ParameterType
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()

find(`predicate`, `thisArg`?): `number`

Returns the value of the first element in the array where predicate is true, and undefined otherwise.

ParameterType
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()

findIndex(`predicate`, `thisArg`?): `number`

Returns the index of the first element in the array where predicate is true, and -1 otherwise.

ParameterType
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()

forEach(`callbackfn`, `thisArg`?): `void`

Performs the specified action for each element in an array.

ParameterType
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()

indexOf(`searchElement`, `fromIndex`?): `number`

Returns the index of the first occurrence of a value in an array.

ParameterType
Firstnumber
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()

join(`separator`?): `string`

Adds all the elements of an array separated by the specified separator string.

ParameterType
Firststring
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()

keys(): `IterableIterator`\<`number`\>

Returns an list of keys in the array

<number>

Inherited from

Uint8Array.keys


lastIndexOf()

lastIndexOf(`searchElement`, `fromIndex`?): `number`

Returns the index of the last occurrence of a value in an array.

ParameterType
Firstnumber
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()

map(`callbackfn`, `thisArg`?): `Uint8Array`

Calls a defined callback function on each element of an array, and returns an array that contains the results.

ParameterType
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()

read(`length`): `Uint8Array`
ParameterType
Firstnumber

readFloat64()

readFloat64(): `number`

readPaddedString()

readPaddedString(`length`): `string`
ParameterType
Firstnumber

readString()

readString(`length`): `string`
ParameterType
Firstnumber

readUint16()

readUint16(): `number`

readUint32()

readUint32(): `number`

readUint64()

readUint64(): `number`

readUint8()

readUint8(): `number`

readVarLengthString()

readVarLengthString(): `string`

readVarUint()

readVarUint(): `number`

reduce()

Call Signature

reduce(`callbackfn`): `number`

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

reduce(`callbackfn`, `initialValue`): `number`

####### callbackfn

(previousValue, currentValue, currentIndex, array) => number

initialValue

number

Inherited from

Uint8Array.reduce

Call Signature

reduce\<`U`\>(`callbackfn`, `initialValue`): `U`

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

reduceRight(`callbackfn`): `number`

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

reduceRight(`callbackfn`, `initialValue`): `number`

####### callbackfn

(previousValue, currentValue, currentIndex, array) => number

initialValue

number

Inherited from

Uint8Array.reduceRight

Call Signature

reduceRight\<`U`\>(`callbackfn`, `initialValue`): `U`

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()

reset(): `void`

Resets the read and write position of the buffer to zero.


reverse()

reverse(): `Uint8Array`

Reverses the elements in an Array.

Inherited from

Uint8Array.reverse


set()

set(`array`, `offset`?): `void`

Sets a value or an array of values.

ParameterType
FirstArrayLike<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()

slice(`start`?, `end`?): `Uint8Array`

Returns a section of an array.

ParameterType
Firstnumber
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()

some(`predicate`, `thisArg`?): `boolean`

Determines whether the specified callback function returns true for any element of an array.

ParameterType
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()

sort(`compareFn`?): `this`

Sorts an array.

ParameterType
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.
[11,2,22,1].sort((a, b) => a - b)

Inherited from

Uint8Array.sort


subarray()

subarray(`start`?, `end`?): `Uint8Array`

Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive.

ParameterType
Firstnumber
The index of the end of the array.

Overrides

Uint8Array.subarray


toLocaleString()

toLocaleString(): `string`

Converts a number to a string by using the current locale.

Inherited from

Uint8Array.toLocaleString


toString()

toString(): `string`

Returns a string representation of an array.

Inherited from

Uint8Array.toString


valueOf()

valueOf(): `Uint8Array`

Returns the primitive value of the specified object.

Inherited from

Uint8Array.valueOf


values()

values(): `IterableIterator`\<`number`\>

Returns an list of values in the array

<number>

Inherited from

Uint8Array.values


write()

write(`array`): `void`
ParameterType
FirstUint8Array

writeFloat64()

writeFloat64(`value`): `void`
ParameterType
Firstnumber

writePaddedString()

writePaddedString(`value`, `length`): `void`
ParameterType
Firstnumber

writeString()

writeString(`value`, `length`): `void`
ParameterType
Firstnumber

writeUint16()

writeUint16(`value`): `void`
ParameterType
Firstnumber

writeUint32()

writeUint32(`value`): `void`
ParameterType
Firstnumber

writeUint64()

writeUint64(`value`): `void`
ParameterType
Firstnumber

writeUint8()

writeUint8(`value`): `void`
ParameterType
Firstnumber

writeVarLengthString()

writeVarLengthString(`value`): `void`
ParameterType
Firststring

writeVarUint()

writeVarUint(`value`): `void`
ParameterType
Firstnumber

from()

Call Signature

`static` from(`arrayLike`): `Uint8Array`

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

`static` from\<`T`\>(`arrayLike`, `mapfn`, `thisArg`?): `Uint8Array`

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

`static` from(`arrayLike`, `mapfn`?, `thisArg`?): `Uint8Array`

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()

`static` of(...`items`): `Uint8Array`

Returns a new array from a set of elements.

ParameterType
First...number[]
A set of elements to include in the new array object.

Inherited from

Uint8Array.of


varLengthStringSize()

`static` varLengthStringSize(`value`): `number`
ParameterType
Firststring

varUintSize()

`static` varUintSize(`value`): `number`
ParameterType
Firstnumber

On this page

ExtendsIndexableConstructorsnew SerialBuffer()Overridesnew SerialBuffer()OverridesProperties[toStringTag]Inherited frombufferInherited frombyteLengthInherited frombyteOffsetInherited fromBYTES_PER_ELEMENTInherited fromlengthInherited fromBYTES_PER_ELEMENTInherited fromEMPTYAccessorsreadPosGet SignatureSet SignaturewritePosGet SignatureSet SignatureMethods[iterator]()Inherited fromcopyWithin()startend?Inherited fromentries()Inherited fromevery()thisArg?Inherited fromfill()start?end?Inherited fromfilter()thisArg?Inherited fromfind()thisArg?Inherited fromfindIndex()thisArg?Inherited fromforEach()thisArg?Inherited fromindexOf()fromIndex?Inherited fromjoin()Inherited fromkeys()Inherited fromlastIndexOf()fromIndex?Inherited frommap()thisArg?Inherited fromread()readFloat64()readPaddedString()readString()readUint16()readUint32()readUint64()readUint8()readVarLengthString()readVarUint()reduce()Call SignatureInherited fromCall SignatureinitialValueInherited fromCall SignatureType ParametersinitialValueInherited fromreduceRight()Call SignatureInherited fromCall SignatureinitialValueInherited fromCall SignatureType ParametersinitialValueInherited fromreset()reverse()Inherited fromset()offset?Inherited fromslice()end?Inherited fromsome()thisArg?Inherited fromsort()Inherited fromsubarray()OverridestoLocaleString()Inherited fromtoString()Inherited fromvalueOf()Inherited fromvalues()Inherited fromwrite()writeFloat64()writePaddedString()writeString()writeUint16()writeUint32()writeUint64()writeUint8()writeVarLengthString()writeVarUint()from()Call SignatureInherited fromCall SignatureType ParametersmapfnthisArg?Inherited fromCall Signaturemapfn?thisArg?Inherited fromof()Inherited fromvarLengthStringSize()varUintSize()