2

To decompress chunks of data i am using boosts iostreams::zlib_decompressor. First id like to show you my decompression code with boost

boost::iostreams::filtering_istreambuf in;
in.push(boost::iostreams::zlib_decompressor());
in.push(boost::interprocess::basic_vectorstream<std::vector<char>>(chunkData));

std::vector<char> decomp;
boost::iostreams::copy(in, boost::interprocess::basic_vectorstream < std::vector < char >> (decomp));

At copy i get an exception that zlib reported Z_DATA_ERROR.

To test if its a problem with my data i wrote it to a file and then used my own inflate program (it just uses the example from zlibs page about inflate, default settings) to inflate that file. Not only don't I get any errors but the correct data is returned by my program.

Does boost use some fancy settings for decompression or am I using the filtering_istreambuf wrong?

Muepe
  • 671
  • 3
  • 14

0 Answers0