Boost logo

Boost Users :

Subject: [Boost-users] [iostreams] gzip problem
From: Olaf Krzikalla (olaf.krzikalla_at_[hidden])
Date: 2014-02-21 08:00:52

Hi @boost,

I have a file format containing chunks of gzipped data (using
gzip_decompressor/gzip_compressor). Inbetween these chunks there is
other (plain) data. So can keep the archive seekable. However apparently
this doesn't work out as it should. Whenever gzip_decompressor reaches
the end of a chunk it throws an exception. The trouble-making line is in

if (footer_.done()) {
   if (footer_.crc() != this->crc())
   int c = boost::iostreams::get(peek);
   if (traits_type::is_eof(c)) {
     state_ = s_done;
   } else {
     base_type::close(peek, BOOST_IOS::in);
     state_ = s_start;

Thus after the footer is read and checked, the decompressor checks
whether or not eof is reached. Obvisiously this isn't the case here -
the decompressed chunk is just embedded in the file. Thus the
decompressor restarts, but cannot find another header thus throwing an
Would it be reasonable to just insert a break?

+ break;

This would solve _my_ problem. Or is there another way to work around
this issue?

Best Olaf

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at