pack

fun pack(archive: SdatArchive): ByteArray

Serialises an SdatArchive into a valid SDAT byte array.

File order within the FAT/FILE blocks: SSEQ files first, then SBNK, SWAR, STRM. Each file blob is padded to a 32-byte boundary before the next one. A SYMB block is included only when at least one entry carries a name that differs from the generated fallback (e.g. "SSEQ_0", "SBNK_1", …). Archives whose every entry uses a fallback name are repacked without a SYMB block, preserving the original structure of archives that never had one.

Return

A fully formed SDAT byte array.

Parameters

archive

The archive to serialise.