tags:

views:

231

answers:

2

My program is using HTTP to read gzipped files over the network.
I need my program to be able to unzip the content and parse it even when not all the gzipped file arrived yet.
Can it be done ?
If so, can it be done in C++ ? If so, how ?

+4  A: 

http://www.zlib.net/

Zlib is able to read gzip. Have a look at the manual. http://www.zlib.net/manual.html#Gzip

Ronny
All I see is gzip related functions related to handling gzipped files from disk. I need to ungzip gzipped stream in memory
Guy
shoot!Search the docs http://www.zlib.net/manual.html#Introduction with "gzip" and many sections appear describing the behavior when dealing with gzip streams. From that and the introductory text in the docs I draw the conclusion that reading gzip streams is possible through the usual inflate / deflate interface.
Ronny
+4  A: 

You could probably try out the gzstream library:

Gzstream is a small C++ library, basically just a wrapper, that provides the functionality of the zlib C-library in a C++ iostream. It is freely available under the LGPL license.

hlovdal
I need to decompress gzipped content in memory. I didn't see how this library can help me.
Guy