Skip to content

Instantly share code, notes, and snippets.

@daleobrien
Created March 13, 2013 09:52
Show Gist options
  • Save daleobrien/5150658 to your computer and use it in GitHub Desktop.
Save daleobrien/5150658 to your computer and use it in GitHub Desktop.
gzip decompression, in memory
namespace io = boost::iostreams; //<-- good practicetypedef
std::vector<char> buffer_t;
void CompressionUtils::Inflate(const buffer_t &compressed, buffer_t &decompressed){
io::filtering_ostream os;
os.push(io::gzip_decompressor());
os.push(io::back_inserter(decompressed));
io::write(os, &compressed[0], compressed.size());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment