Interface ReadBuffer

A buffer maintaining a read position in a buffer containing a received message capable of reading primitive values.

interface ReadBuffer {
    readBytes(): Uint8Array;
    readLength(): number;
    readNumber(): number;
    readString(): string;
    readUint16(): number;
    readUint32(): number;
    readUint8(): number;
    sliceAtReadPosition(): ReadBuffer;
}

Implemented by

Methods

  • Returns a new read buffer whose starting read position is the current read position of this buffer. This is useful to create read buffers sub messages. (e.g. when using a multiplexer the beginning of the message might contain some protocol overhead which should not be part of the message reader that is sent to the target channel)

    Returns ReadBuffer