Compression formats with good support for random access within archives?

前端 未结 13 2413
滥情空心
滥情空心 2020-11-27 11:45

This is similar to a previous question, but the answers there don\'t satisfy my needs and my question is slightly different:

I currently use gzip compression for som

13条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 12:12

    The .xz file format (which uses LZMA compression) seems to support this:

    Random-access reading: The data can be split into independently compressed blocks. Every .xz file contains an index of the blocks, which makes limited random-access reading possible when the block size is small enough.

    This should be sufficient for your purpose. A drawback is that the API of liblzma (for interacting with these containers) does not seem that well-documented, so it may take some effort figuring out how to randomly access blocks.

提交回复
热议问题