Decompression Problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Decompression Problem

Robert Vinluan
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 mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users