Boost logo

Boost Users :

From: Mathieu Peyréga (mathieu.peyrega_at_[hidden])
Date: 2006-12-10 13:21:55


> I am not a boost iostreams expert... just a user. Having said that, if
> iostreams::read() can return -1 during the copy_impl then it looks like
> the original code could be a problem.

and it happens... it is indeed the test used to detect the end of the
loop...

> What was your test case to demonstrate this?

was something like

short *data = new short[w*h];

for(int index_ligne=0;index_ligne<w;++index_ligne)
{
        TIFFReadScanline(handler,data+(index_ligne*w), index_ligne);
}

ofstream file(filename.c_str(), ios_base::out|ios_base::binary);
filtering_streambuf<output> out;
out.push(bzip2_compressor());
out.push(file);

basic_array_source<char> datastream((char*)data,w*h*sizeof(short));
boost::iostreams::copy(datastream, out);

Regards,

Mathieu

--
http://matioupi.free.fr/

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