|
![](/i/fill.gif) |
On 31/10/2011 05:36 PM, Warp wrote:
> Invisible<voi### [at] dev null> wrote:
>> I had expected the zlib itself merely takes a pointer to a buffer full
>> of data, and a pointer to an empty buffer, and moves data from one to
>> the other, compressing or decompressing as requested. I'm surprised it
>> actually implements anything as high-level as file access.
>
> If the data you are decompressing doesn't fit into RAM, how are you
> supposed to decompress it? (Answer: By streaming. In other words,
> decompress small parts at a time. This requires more than one simple
> "decompress this" function.)
As I say, I would have expected a function that takes two buffers, and
then returns some sort of indication of how much data it processed. You
can then call it again to process the next chunk. The only really tricky
bit is flushing the end of the stream.
But yeah, I guess that might be complicated enough to merit having
functions especially for the common case of wanting to compress a file
on disk...
Post a reply to this message
|
![](/i/fill.gif) |