Vertex Viewer SDK
    Preparing search index...

    Interface BinaryReader

    A BinaryReader represents a view and offset for iteratively reading data from an ArrayBuffer.

    Readers are created by calling the BinaryReader.fromArrayBuffer() method, and passed to helper methods such as BinaryReader.readInt32() to read data from the buffer. These helpers return a new BinaryReader that contains an adjusted offset and the read value, and can further be passed to additional helpers.

    // Reading from an `ArrayBuffer`
    const reader = BinaryReader.fromArrayBuffer(buffer);
    const messageLength = BinaryReader.readInt32(reader);
    console.log(messageLength.value); // 11

    const message = BinaryReader.readUtf8String(messageLength.value, messageLength);
    console.log(message.value); // Hello world
    interface BinaryReader {
        data: DataView;
        offset: number;
    }
    Index
    data: DataView
    offset: number