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

    Class SyncFileSliceReader

    A FileSliceReader that uses the worker-only FileReaderSync API for bounded synchronous reads. This is deliberately separate from FileSliceReader: FileReaderSync is not available on the window global, so synchronous reads only work inside a Web Worker.

    Hierarchy (View Summary)

    Implements

    Index
    size: number

    Total number of bytes in the source.

    blob: Blob

    The File or Blob to read from.

    • 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 the bytes read, clamped to the source.

      position or length is negative or not an integer.

    • Read up to length bytes starting at position, synchronously.

      Parameters

      • position: number

        Zero-based byte offset to start reading from.

      • length: number

        Maximum number of bytes to read.

      Returns Uint8Array

      The bytes read, clamped to the source.

      position or length is negative or not an integer.

      FileReaderSync is not available (not running inside a Web Worker).