Binary Raw - Docs
    Preparing search index...

    Interface FileHandle

    Represents an open file handle for reading and writing binary data. Abstracts the underlying storage mechanism (local file, remote, or memory).

    interface FileHandle {
        id: string;
        lastModified: number;
        name: string;
        readable: boolean;
        size: ByteCount;
        source: "local" | "remote" | "memory";
        writable: boolean;
        close(): Promise<void>;
        read(range: ByteRange): Promise<Uint8Array<ArrayBufferLike>>;
        write(range: ByteRange, data: Uint8Array): Promise<void>;
    }
    Index

    Properties

    id: string

    Unique identifier for this file handle.

    lastModified: number

    Last modification timestamp (Unix ms).

    name: string

    Display name of the file.

    readable: boolean

    Whether the file can be read.

    size: ByteCount

    Size of the file in bytes.

    source: "local" | "remote" | "memory"

    Source of the file data.

    writable: boolean

    Whether the file can be written to.

    Methods

    • Closes the file handle and releases resources.

      Returns Promise<void>

    • Reads bytes from a specific range.

      Parameters

      Returns Promise<Uint8Array<ArrayBufferLike>>

      Promise resolving to the raw bytes read.

    • Writes bytes to a specific range.

      Parameters

      • range: ByteRange

        The byte range to write to.

      • data: Uint8Array

        The data to write.

      Returns Promise<void>