Boost logo

Boost Users :

Subject: Re: [Boost-users] count compressed bytes
From: Philipp Kraus (philipp.kraus_at_[hidden])
Date: 2010-06-11 07:06:46


On 2010-06-11 09:41:40 +0200, Roland Bock said:

> Kraus Philipp wrote:
>> Hi,
>>
>> I have implemented this litte code to compress a file
>>
>> bio::filtering_streambuf< bio::input > l_deflate;
>> switch (m_compress) {
>> case gzip : l_deflate.push( bio::gzip_compressor() ); break;
>> case bzip2 : l_deflate.push( bio::bzip2_compressor() ); break;
>> }
>>
>>
>>
>> l_deflate.push( bio::file_source(p_str, BOOST_IOS::binary) );
>>
>>
>> I need only the number of compressed bytes of l_deflate. I try to
>>
>> use l_deflate.size() but it returns only a fixed number.
>>
>>
>> How I can read the number of compressed bytes?
>>
>>
>> Thanks
>>
>>
>> Phil
>>
>
> The only method I know is to add a small filter which counts the Bytes.

I have found this
http://www.boost.org/doc/libs/1_43_0/boost/iostreams/filter/counter.hpp
Can I use this class? I don't know how I can use the class (must I only
create a new object and push it to my l_deflate) ?


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