Recursive AI

Single compressed files and .tar.* archives

All onearchive docs

A .gz, .bz2, .zst, .lz4, .xz or .lz file that holds no container is an archive of one file (ArchiveFormat.SingleStream). Brotli (.br) has no magic number, so it is recognised by its file name only. A tar inside any of these is one archive. The normative rules (detection order, the entry name, writing) are in archive.md ("Detection", "Single compressed files").

TypesSingleStreamReader, SingleStreamWriter, ArchiveCompression
Detectionmagic bytes first, then the first 512 bytes of the decompressed stream, then the file name
Entry namethe gzip header's file name, else the archive name without its compression extension, else data
Writingexactly one regular file; levels through ArchiveCreateOptions.CompressionLevel
Limitsthe whole decompressed stream is metered against MaxTotalSize and MaxExpansionRatio; the window (Zstandard) or dictionary (xz, lzip) a stream may declare is limited by MaxWindowSize, 8 MiB by default