@cityjson/flatcitybuf
    Preparing search index...

    Class BytesRangeReader

    In-memory RangeReader. COPIES its input on construction: later mutation of the caller's array, or an ArrayBuffer transfer/detach (e.g. handing the original off to a worker), must not be able to corrupt an already- open reader.

    Implements

    Index
    • Resolves to EXACTLY length bytes starting at offset, or rejects with an FcbError. Never returns a short buffer, and never clamps a range that crosses the end of the resource. The returned array MAY be a view into a buffer the reader reuses on its next call, so a caller that needs the bytes to outlive the next read must copy them.

      Parameters

      • offset: number
      • length: number
      • Optionalopts: ReadOpts

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • The resource's total byte length. Synchronous by contract: every source learns its size when it opens (a stat, blob.size, or a Content-Range at open time), so the reader's layout arithmetic never has to await.

      Returns number