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
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.