ic-reactor
    Preparing search index...

    Class PipeArrayBuffer

    A class that abstracts a pipe-like Uint8Array.

    Index

    Constructors

    • Creates a new instance of a pipe

      Parameters

      • Optionalbuffer: Uint8Array<ArrayBufferLike>

        an optional buffer to start with

      • Optionallength: number

        an optional amount of bytes to use for the length.

      Returns utils.candid.PipeArrayBuffer

    Accessors

    • get buffer(): Uint8Array

      Returns Uint8Array

    • get byteLength(): number

      Returns number

    • get end(): boolean

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

      Returns boolean

    Methods

    • Save a checkpoint of the reading view (for backtracking)

      Returns Uint8Array

    • Restore a checkpoint of the reading view (for backtracking)

      Parameters

      • checkPoint: Uint8Array

        a previously saved checkpoint

      Returns void

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

      Parameters

      • num: number

        The number of bytes to read.

      Returns Uint8Array

    • Returns undefined | number

    • Write a buffer to the end of the pipe.

      Parameters

      Returns void

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

      Parameters

      • amount: number

        A number of bytes to add to the buffer.

      Returns void