473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

zlib APIs usage problem in C++ program

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
1 2435
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Greg Bakken | last post by:
I am writing a python program that recieves 'compressed and encoded' strings from another piece of software. I can successfully uncompress and decode the strings via import base64, zlib def...
3
by: Alan Toppen | last post by:
I was unable to use the ZipFile class in the zipfile module in Python2.4. I got an error that zlib could not be found. Comparing my Python 2.2 installation I noticed Python 2.4 was missing a...
4
by: Peter | last post by:
Hi, Not sure if this is a proper ng to post this question. Is here anybody who has used zlib? I downloaded 1.2.1 of zlib from www.gzip.org/zlib (for windows 98/nt/2000/xp), and used it in my...
6
by: Laszlo Zsolt Nagy | last post by:
Sorry, I realized that the import zlib was not executed from my (working) service. So here is the question: why can't I use zlib from a win32 service? Is there any way to make it working? ...
1
by: Dennis Powell | last post by:
Does anyone have a successful implementaion of the zlib.dll in VB. Net they can show me. I'm writting a class encaplsulating zlib functionality and I keep getting a System.NullReferenceException...
12
by: Sankar | last post by:
Dear all, I am programming in Linux , wherein I need to know a couple of things. 1) Does an API exist that can copy file onto another file ( an API equivalent of 'cp') ? 2) Is there an API...
4
by: shamzz | last post by:
Hi, I've compiled (configure/make/make install) Python 2.4.4 from source on Suse Linux Enterprise Server 9 (x64). I need Python to be compiled with Zlib so that I can compile and use Zope. ...
4
by: ZedLep | last post by:
Hello, First of all I'm a relatively inexperienced C++ programmer so this may seem a simple question to answer. I'm trying to use zlib from www.zlib.net to decompress some data. However I run...
4
by: MZ | last post by:
Hello! I`ve tried to instal zlib library to use zip functions to pack files into zip archive. I don`t know how I have to configure zlib to make it work. I have built up php.ini file and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.