mimekit-ts - v1.0.0
    Preparing search index...

    Interface RandomAccessReader

    A seekable, length-known byte source read asynchronously.

    interface RandomAccessReader {
        size: number;
        readAt(
            position: number,
            length: number,
        ): Promise<Uint8Array<ArrayBufferLike>>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    size: number

    Total number of bytes in the source. Known up front for every backing store the adapters target (Blob.size, fstat, byteLength), so it is a synchronous property rather than a promise.

    • Read up to length bytes starting at position.

      Parameters

      • position: number

        Zero-based byte offset to start reading from.

      • length: number

        Maximum number of bytes to read.

      Returns Promise<Uint8Array<ArrayBufferLike>>

      A promise for an independent copy of the bytes read, clamped to the source: its .length is at most min(length, size - position) and may be 0 at or past the end.

      position or length is negative or not an integer.