Skip to main content

Module container

Module container 

Source
Expand description

The chunked container.

Layout, all integers little-endian:

header  "BREAD\0\r\n" (8 bytes), container version u16
chunk   tag [u8; 4], chunk version u16, raw length u64,
        stored length u64, CRC-32 of the stored bytes u32,
        stored bytes (zstd)
...     chunks until the end of the file

The \r\n in the magic catches a file mangled by a text-mode transfer, as PNG’s does.

Structs§

BreadReader
Reads a .bread file chunk by chunk.
BreadWriter
Writes a .bread file chunk by chunk.
Chunk
One chunk read back: its tag, version and decompressed payload.
ChunkTag
A chunk’s kind, four ASCII bytes.

Enums§

ReadBreadError
Why a .bread file could not be read.

Constants§

CONTAINER_VERSION
The container layout this build writes and reads.
MAGIC
The first bytes of every .bread file.