Boost logo

Boost Users :

From: Meryl Silverburgh (silverburgh.meryl_at_[hidden])
Date: 2007-07-05 15:34:14


Thanks for the poniters.

>From this example, how can I just pass not the whole file, but the
file starting at the 5th byte to the end to zlib_decompressor()?

#include <fstream>
#include <iostream>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/zlib.hpp>

int main()
{
    using namespace std;

    ifstream file("hello.z", ios_base::in | ios_base::binary);
    filtering_streambuf<input> in;
    in.push(zlib_decompressor());
    in.push(file);
    boost::iostreams::copy(in, cout);
}

On 7/4/07, eg <egoots_at_[hidden]> wrote:
> Meryl Silverburgh wrote:
> > Hi,
> >
> > Can you please tell me how can I use boost iostream with zlib to
> > inflate an byte stream?
> > Where can I find an example?
> >
>
> The library docs have some examples in them.
> See:
> http://boost.org/libs/iostreams/doc/index.html
>
> Navigate to the Quick Reference and click on the
> "basic_zlib_decompressor" filter link. At the bottom of the page you
> will see an example.
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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