By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,330 Members | 1,443 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,330 IT Pros & Developers. It's quick & easy.

zlib APIs usage problem in C++ program

P: n/a
Hello Group,

I am writing a http client and reading a web page from the server. The
page can be compressed in any
of the format namely; gzip or deflate or compress. My client reads the
page in chunks from the socket
and then passes on the decompressed data to the user.

I am makeing use of zlib APIs to decompress the data read from the
server.

The problem I am having is that these APIs can only compress the data
if it is in a file,, whereas my
requirement is to decompress the data from the buffer.

Can someone tell me with a better solution or must I first put the read
data from socket into the file and
then decompress data by using the zlib APIs.

Thx.

nagrik

Jun 29 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
nagrik schrieb:
Hello Group,

I am writing a http client and reading a web page from the server. The
page can be compressed in any
of the format namely; gzip or deflate or compress. My client reads the
page in chunks from the socket
and then passes on the decompressed data to the user.

I am makeing use of zlib APIs to decompress the data read from the
server.
Third party libraries are offtopic in this group.
The problem I am having is that these APIs can only compress the data
if it is in a file,, whereas my
requirement is to decompress the data from the buffer.


Not true. The zlib can work on buffers. Look at these functions:

deflateInit, deflate, inflateInit, inflate

If you have questions about these, you have to ask in another place.

Thomas
Jun 29 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.