From 152d21f6c22e48d449bbcf2ac46ca527426fbadf Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Mon, 15 May 2023 21:02:19 +0200 Subject: [PATCH] add specification for bzip3 --- archive/bzip3.ksy | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 archive/bzip3.ksy diff --git a/archive/bzip3.ksy b/archive/bzip3.ksy new file mode 100644 index 000000000..081af2406 --- /dev/null +++ b/archive/bzip3.ksy @@ -0,0 +1,35 @@ +meta: + id: bzip3 + title: Bzip3 header + file-extension: bz3 + license: LGPL-3.0 + encoding: UTF-8 + endian: le +doc-ref: https://github.com/kspalaiologos/bzip3 +seq: + - id: header + type: header + - id: blocks + type: compressed_data_block + repeat: until + repeat-until: _io.eof or _.is_last +types: + header: + seq: + - id: signature + contents: 'BZ3v1' + - id: block_size + type: u4 + compressed_data_block: + seq: + - id: len_compressed + type: u4 + - id: len_uncompressed + type: u4 + valid: + max: _root.header.block_size + - id: data + size: len_compressed + instances: + is_last: + value: len_uncompressed < _root.header.block_size