detectCompressedArchive

fnCompressedArchiveInfo detectCompressedArchive(const(ubyte)[] header)

Detect if data is a compressed archive and return info.

Checks for known compression wrappers around archive formats, such as GZIP+TAR (.tar.gz), BZIP2+TAR (.tar.bz2), XZ+TAR (.tar.xz), LZ4+TAR, and ZSTD+TAR.

Detection only examines the outer compression magic; the inner format is not verified here. assumedInnerArchive reports the conventional guess (TAR) — a plain compressed file such as a .gz text file or .zip.zst cannot be distinguished without decompressing. openCompressedArchive detects the real inner format after decompression.

Parameters

headerFirst bytes of the data to examine.

Returns

A CompressedArchiveInfo describing the detected layers.