SerialBuffer
Extends:
Static Method Summary
Static Public Methods | ||
public static |
varLengthStringSize(value: string): number |
|
public static |
varUintSize(value: number): number |
Constructor Summary
Public Constructor | ||
public |
constructor(bufferOrArrayOrLength: *) |
Member Summary
Public Members | ||
public get |
readPos: number |
|
public set |
readPos: number |
|
public get |
writePos: number |
|
public set |
writePos: number |
Method Summary
Public Methods | ||
public |
read(length: number): Uint8Array |
|
public |
readFloat64(): number |
|
public |
readPaddedString(length: number): string |
|
public |
readString(length: number): string |
|
public |
readUint16(): number |
|
public |
readUint32(): number |
|
public |
readUint64(): number |
|
public |
readUint8(): number |
|
public |
readVarLengthString(): string |
|
public |
readVarUint(): number |
|
public |
reset(): void Resets the read and write position of the buffer to zero. |
|
public |
subarray(start: number, end: number): Uint8Array |
|
public |
write(array: *) |
|
public |
writeFloat64(value: number) |
|
public |
writePaddedString(value: string, length: number) |
|
public |
writeString(value: string, length: number) |
|
public |
writeUint16(value: number) |
|
public |
writeUint32(value: number) |
|
public |
writeUint64(value: number) |
|
public |
writeUint8(value: number) |
|
public |
writeVarLengthString(value: string) |
|
public |
writeVarUint(value: number) |
Static Public Methods
public static varLengthStringSize(value: string): number source
Params:
Name | Type | Attribute | Description |
value | string |
Return:
number |
public static varUintSize(value: number): number source
Params:
Name | Type | Attribute | Description |
value | number |
Return:
number |
Public Constructors
public constructor(bufferOrArrayOrLength: *) source
Params:
Name | Type | Attribute | Description |
bufferOrArrayOrLength | * |
Public Members
public get readPos: number source
public set readPos: number source
public get writePos: number source
public set writePos: number source
Public Methods
public read(length: number): Uint8Array source
Params:
Name | Type | Attribute | Description |
length | number |
Return:
Uint8Array |
public readPaddedString(length: number): string source
Params:
Name | Type | Attribute | Description |
length | number |
Return:
string |
public readString(length: number): string source
Params:
Name | Type | Attribute | Description |
length | number |
Return:
string |
public subarray(start: number, end: number): Uint8Array source
Params:
Name | Type | Attribute | Description |
start | number | ||
end | number |
Return:
Uint8Array |
public write(array: *) source
Params:
Name | Type | Attribute | Description |
array | * |
public writeFloat64(value: number) source
Params:
Name | Type | Attribute | Description |
value | number |
public writePaddedString(value: string, length: number) source
Params:
Name | Type | Attribute | Description |
value | string | ||
length | number |
public writeString(value: string, length: number) source
Params:
Name | Type | Attribute | Description |
value | string | ||
length | number |
public writeUint16(value: number) source
Params:
Name | Type | Attribute | Description |
value | number |
public writeUint32(value: number) source
Params:
Name | Type | Attribute | Description |
value | number |
public writeUint64(value: number) source
Params:
Name | Type | Attribute | Description |
value | number |
public writeUint8(value: number) source
Params:
Name | Type | Attribute | Description |
value | number |
public writeVarLengthString(value: string) source
Params:
Name | Type | Attribute | Description |
value | string |
public writeVarUint(value: number) source
Params:
Name | Type | Attribute | Description |
value | number |