Seeking on gzip streams?
Dear Lazyweb,
do you know anything that implements seeking on gzip/zlib streams?
Seeking forward is easily done by reading the data up to the requested position, which isn't nice, but works well. Seeking backwards may be implemented by something like this:
inflateEnd (&stream); fseek (input, 0, SEEK_SET); inflateInit (&stream); /* read up to the requested position */
This will be terribly slow for some cases, but well..
I'm just wondering how seeking with SEEK_END could be implemented without inflating the whole stream at first.
Comments on Seeking on gzip streams? | no comments | Post a comment