The chunk is composed by a header and a blocks / splits section:
+---------+--------+---------+ | header | blocks / splits | +---------+--------+---------+
These are described below.
Blosc (as of Version 1.0.0) has the following 16 byte header that stores information about the compressed buffer:
|-0-|-1-|-2-|-3-|-4-|-5-|-6-|-7-|-8-|-9-|-A-|-B-|-C-|-D-|-E-|-F-| ^ ^ ^ ^ | nbytes | blocksize | cbytes | | | | | | | | +--typesize | | +------flags | +----------versionlz +--------------version
All entries are little endian.
version: |
( |
||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
versionlz: |
( |
||||||||||||||||||||||||||
flags and compressor enumeration: |
(
The last three bits form an enumeration that allows to use alternative compressors.
|
||||||||||||||||||||||||||
typesize: |
( |
||||||||||||||||||||||||||
nbytes: |
( |
||||||||||||||||||||||||||
blocksize: |
( |
||||||||||||||||||||||||||
cbytes: |
( |
After the header, there come the blocks / splits section. Blocks are equal-sized parts of the chunk, except for the last block that can be shorter or equal than the rest.
At the beginning of the blocks section, there come a list of int32_t bstarts to indicate where the different encoded blocks starts (counting from the end of this bstarts section):
+=========+=========+========+=========+ | bstart0 | bstart1 | ... | bstartN | +=========+=========+========+=========+
Finally, it comes the actual list of compressed blocks / splits data streams. It turns out that a block may optionally (see bit 4 in flags above) be further split in so-called splits which are the actual data streams that are transmitted to codecs for compression. If a block is not split, then the split is equivalent to a whole block. Before each split in the list, there is the compressed size of it, expressed as an int32_t:
+========+========+========+========+========+========+========+ | csize0 | split0 | csize1 | split1 | ... | csizeN | splitN | +========+========+========+========+========+========+========+
Note: all the integers are stored in little endian.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。