Preparing search index...

    Wraps a byte array for data serialization and deserialization.

        const bytes = new Uint8Array([72, 101, 108, 108, 111]); // "Hello"
    const buffer = new Editor.Buffer(bytes);

    // Round-trip: toBytes() recovers the original byte array
    const roundTripped = buffer.toBytes();
    const matches = roundTripped.every((b: number, i: number) => b === bytes[i]);

    console.log(`Buffer "${buffer.toString()}" (${roundTripped.length} bytes), round-trip match: ${matches}`);
    Index

    Constructors

    Methods

    Constructors

    • Create a buffer from a byte array.

      Parameters

      • bytes: Uint8Array

      Returns Buffer

    Methods

    • Return the underlying byte array.

      Returns Uint8Array

    • Return the buffer contents as a UTF-8 string.

      Returns string