Skip to main content

Class: Buffer

bytes.Buffer Buffer is a bytes/Uint8Array type in javascript Example
Example

Table of contents

Constructors

Methods

Constructors

constructor

• new Buffer(): Buffer

Returns

Buffer

Defined in

bytes.ts:21

Methods

Bytes

▸ Bytes(): Uint8Array Bytes returns the byte representation of the buffer.

Returns

Uint8Array Example

Defined in

bytes.ts:60

Hex

▸ Hex(): string Hex returns the hex representation of the buffer.

Returns

string Example

Defined in

bytes.ts:105

Hexdump

▸ Hexdump(): string Hexdump returns the hexdump representation of the buffer.

Returns

string Example

Defined in

bytes.ts:120

Len

▸ Len(): number Len returns the length of the buffer.

Returns

number Example

Defined in

bytes.ts:90

Pack

▸ Pack(formatStr, msg): void Pack uses structs.Pack and packs given data and appends it to the buffer. it packs the data according to the given format.

Parameters

Returns

void Example

Defined in

bytes.ts:135

String

▸ String(): string String returns the string representation of the buffer.

Returns

string Example

Defined in

bytes.ts:75

Write

▸ Write(data): Buffer Write appends the given data to the buffer.

Parameters

Returns

Buffer Example

Defined in

bytes.ts:31

WriteString

▸ WriteString(data): Buffer WriteString appends the given string data to the buffer.

Parameters

Returns

Buffer Example

Defined in

bytes.ts:45