Reader: (position: number, length: number) => Promise<Buffer>

Type definition for reading content from a VersaTiles container.

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

Type declaration

    • (position: number, length: number): Promise<Buffer>
    • Parameters

      • position: number

        The byte offset at which to start reading.

      • length: number

        The number of bytes to read.

      Returns Promise<Buffer>

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

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.