Expand description
§Format specification for Puffin files
§File structure
Magic Blob₁ Blob₂ … Blobₙ Footer
Magic
is four bytes 0x50, 0x46, 0x41, 0x31 (short for: Puffin Fratercula arctica, version 1),Blobᵢ
is i-th blob contained in the file, to be interpreted by application according to the footer,Footer
is defined below.
§Footer structure
Magic FooterPayload FooterPayloadSize Flags Magic
Magic
: four bytes, same as at the beginning of the fileFooterPayload
: optionally compressed, UTF-8 encoded JSON payload describing the blobs in the file, with the structure described belowFooterPayloadSize
: a length in bytes of theFooterPayload
(after compression, if compressed), stored as 4 byte integerFlags
: 4 bytes for boolean flags- byte 0 (first)
- bit 0 (lowest bit): whether
FooterPayload
is compressed - all other bits are reserved for future use and should be set to 0 on write
- bit 0 (lowest bit): whether
- all other bytes are reserved for future use and should be set to 0 on write A 4 byte integer is always signed, in a two’s complement representation, stored little-endian.
- byte 0 (first)
§Footer Payload
Footer payload bytes is either uncompressed or LZ4-compressed (as a single LZ4 compression frame with content size present),
UTF-8 encoded JSON payload representing a single FileMetadata
object.