API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classContainerReader
Reads assets out of a `.exoa` container, fetching only the blocks it needs. A container's data section is tiled by independently compressed blocks, and a block boundary always falls on an entry boundary. Reading an entry is therefore: find the blocks covering it, obtain each one, decode, slice. Where a block comes from - a byte range, a block store, or a buffer already held - changes the cost but not the result. Decoded blocks are held for the reader's lifetime, so entries sharing a block decode it once. That is the whole reason readEntries exists: reading entries one at a time through separate readers would decompress a shared block once per entry. A reader is not thread-safe across `await` boundaries in the sense of cancellation: pass a `signal` through `init` to abandon in-flight requests.
import { ContainerReader } from '@codexo/exojs'Reads assets out of a `.exoa` container, fetching only the blocks it needs.
A container's data section is tiled by independently compressed blocks, and a block boundary always falls on an entry boundary. Reading an entry is therefore: find the blocks covering it, obtain each one, decode, slice. Where a block comes from - a byte range, a block store, or a buffer already held - changes the cost but not the result.
Decoded blocks are held for the reader's lifetime, so entries sharing a block decode it once. That is the whole reason readEntries exists: reading entries one at a time through separate readers would decompress a shared block once per entry.
A reader is not thread-safe across `await` boundaries in the sense of cancellation: pass a `signal` through `init` to abandon in-flight requests.
readEntries(entries: readonly ContainerEntryOne asset in a container's head. `offset` and `length` address the asset's own bytes within the uncompressed data section. `type` is the asset type name resolv…[]): Promise<ArrayBuffer[]>readEntryRange(entry: ContainerEntryOne asset in a container's head. `offset` and `length` address the asset's own bytes within the uncompressed data section. `type` is the asset type name resolv…, offset: number, length: number): Promise<ArrayBuffer>release(): voidfromBuffer(buffer: ArrayBuffer, options: ContainerReaderOptionsHow a ContainerReader is opened.): ContainerReaderopen(url: string, options: ContainerReaderOptionsHow a ContainerReader is opened.): Promise<ContainerReader>byteLength: numberranged: boolean