c0
    Preparing search index...

    Class StreamReader

    Scans a buffer for ETB commit markers and exposes only the committed region. Zero-copy: accessors return subarrays.

    const reader = new StreamReader(buf) reader.torn // uncommitted tail present? reader.eachRecord(rec => { ... }) // committed records only

    Index
    buf: Uint8Array
    • get blockCount(): number

      Number of committed blocks.

      Returns number

    • get committed(): Uint8Array

      The committed region of the buffer.

      Returns Uint8Array

    • get committedEnd(): number

      Offset just past the last commit marker and its payload.

      Returns number

    • get table(): Table

      The committed region as a Table (handles an optional GS name and SOH header, then RS records).

      Returns Table

    • get tail(): Uint8Array

      Uncommitted trailing bytes — residue of an interrupted append.

      Returns Uint8Array

    • get torn(): boolean

      True if uncommitted bytes trail the last commit marker.

      Returns boolean

    • Committed block by index: the bytes between the previous commit and this block's ETB (marker and payload excluded).

      Parameters

      • i: number

      Returns Uint8Array

    • Iterate committed blocks.

      Parameters

      • cb: (block: Uint8Array) => void

      Returns void

    • Iterate committed records.

      Parameters

      Returns void