简体   繁体   中英

Is there way to block uncompress a compressed file using zip, gzip or zlib?

I want to give some sort of an 'offset' where the zlib will start its decompression from at init,

I have control over how file is compressed.

My question is, is there any block or boundary concepts in traditionally compressed files?

Not necessarily looking for 'random access', say start from offset 0, uncompress blocks A, B, and C, (concurrently or serially), and then in future want to continue from block D, (next reboot time init zlib to start from block D, for example).

When working with large files like 10 or 100GB, continuity of uncompressing helps.

Environments: Linux/C/C++

Thanks for your help.

Apparently gztool and bgzf compression tools can help, but they create index files, as well. Winzip, zip or gzip traditionally not block or boundary based, not sure if they can help.

That's what Z_FULL_FLUSH is for. Use that to deflate, writing all available output. Save the offset of the position in that output. You can then later begin a raw inflate from that offset.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM