Reputation: 6424
I have a gzipped file that I need to read and decompress in my application. I just read through the zlib manual, and it appears that the zlib
function are able to operate via memory buffers, but the gzip
interface is all file-based.
What is the most common method of dealing with gzipped files like this? Do I need to handle the gzip file format myself, pull out the deflated data, and pass it to the zlib functions?
Note: The reason file-based will not work is because the file is in an archive on a read-only medium, so I can't extract the file first and use the gzip functions from zlib. This is an embedded Linux system.
Upvotes: 0
Views: 271
Reputation: 112239
You need to "read through" the zlib manual again, this time reading through it. inflateInit2()
has an option to decompress gzip streams.
Upvotes: 1