Boost logo

Boost :

Subject: Re: [boost] [iostreams] binary memory stream
From: Kim Barrett (kab.conundrums_at_[hidden])
Date: 2009-03-30 17:24:54


At 7:41 PM -0500 3/29/09, Kenny Riddile wrote:
>I'm attempting to write to memory instead of a file, by doing this:
>
>using namespace boost::gil;
>using namespace boost::iostreams;
>
>typedef stream< back_insert_device< std::vector<char> > > BufferStream;

   std::vector<char> vbuffer;
   boost::iostreams::filtering_ostream outs(
       boost::iostreams::back_inserter(vbuffer))

is what I've been using to create an in-memory binary output stream.
That is, a filtering stream that has only a sink and no intervening
filters in the chain.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk