@versatiles/container
    Preparing search index...

    Interface Reader

    Type definition for reading content from a VersaTiles container.

    This is useful for implementing new container readers, e.g. reading over other network protocols.

    A reader may optionally expose a close method to release any underlying resources (e.g. a file descriptor). Container.close calls it if present.

    If position is less than 0 or if length is less than 0.

    If the sum of position and length exceeds the size of the content (filesize).

    If there is any filesystem or network error such as the content not being accessible or readable.

    interface Reader {
        close?: () => Promise<void>;
        (position: number, length: number): Promise<Buffer<ArrayBufferLike>>;
    }
    • Parameters

      • position: number

        The byte offset at which to start reading.

      • length: number

        The number of bytes to read.

      Returns Promise<Buffer<ArrayBufferLike>>

      A promise that resolves with the data read as a Buffer.

    Index
    close?: () => Promise<void>

    Releases any underlying resources held by the reader (e.g. an open file descriptor). Optional; readers that hold no resources may omit it. After close resolves, the reader must not be called again.