Skip to content

PipeArrayBuffer

Defined in: packages/candid/src/utils/buffer.ts:18

A class that abstracts a pipe-like Uint8Array.

new PipeArrayBuffer(buffer?, length?): PipeArrayBuffer

Defined in: packages/candid/src/utils/buffer.ts:54

Creates a new instance of a pipe

Uint8Array<ArrayBufferLike>

an optional buffer to start with

number = ...

an optional amount of bytes to use for the length.

PipeArrayBuffer

get buffer(): Uint8Array

Defined in: packages/candid/src/utils/buffer.ts:72

Uint8Array


get byteLength(): number

Defined in: packages/candid/src/utils/buffer.ts:77

number


get end(): boolean

Defined in: packages/candid/src/utils/buffer.ts:127

Whether or not there is more data to read from the buffer

boolean

alloc(amount): void

Defined in: packages/candid/src/utils/buffer.ts:135

Allocate a fixed amount of memory in the buffer. This does not affect the view.

number

A number of bytes to add to the buffer.

void


read(num): Uint8Array

Defined in: packages/candid/src/utils/buffer.ts:85

Read num number of bytes from the front of the pipe.

number

The number of bytes to read.

Uint8Array


readUint8(): undefined | number

Defined in: packages/candid/src/utils/buffer.ts:91

undefined | number


restore(checkPoint): void

Defined in: packages/candid/src/utils/buffer.ts:36

Restore a checkpoint of the reading view (for backtracking)

Uint8Array

a previously saved checkpoint

void


save(): Uint8Array

Defined in: packages/candid/src/utils/buffer.ts:28

Save a checkpoint of the reading view (for backtracking)

Uint8Array


write(buf): void

Defined in: packages/candid/src/utils/buffer.ts:104

Write a buffer to the end of the pipe.

Uint8Array

The bytes to write.

void