Boost logo

Boost Users :

From: Robert Vinluan (rvinluan_at_[hidden])
Date: 2006-02-03 09:42:36


Hi All,

I'm trying to decompress only a fragment of an input stream. I tried
using boost::iostreams::copy() by passing in a value for the buffer_size
parameter.

Here's a code example of what I was trying to do:

    filtering_stream<input> in;
    in.push(gzip_decompressor());

    // 'istr' is an istrstream holding the compressed data.
    in.push(istr);

    // I was hoping this would copy only the first 4 decompressed bytes!!
    boost::iostreams::copy(in, cout, 4);

However, when I execute this, the copy() algorithm copies all
decompressed data, ignoring my 'value' of 4. Perhaps I've misread the
documentation?

Anyway, I'm not sure if this is the correct approach to solve the
problem, or even if there is a solution using boost.

Any suggestions would be helpful.

Thanks in advance,

Rob

P.S. I'm a newbie, so please let me know if this isn't the correct place
to post this message.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net