3 ms·
this isn't my forte but couldn't you memory map the file and use arithmetic to find the chunks to read?
by hderms 11y ago
this isn't my forte but couldn't you memory map the file and use arithmetic to find the chunks to read?
- craigds 11y agoYou need to use a compression format that has sync points. For example, if you need to seek to 1GB in the uncompressed file, the compression itself needs to have recorded where that corresponds to in the compressed file. zlib apparently supports the `Z_FULL_FLUSH` sync option which you can use at compression time to provide sync points. (I haven't used it, and it doesn't seem to be exposed by GNU gzip.) Other compression formats might have something similar.