boost::iostreams de/compress data from memory question.

Hi! Is there anyone know how to use boost::iostreams to de/compress data from memory ?
From file the code bellow works well:
#include <fstream>
#include <iostream>
#include

CPPer wrote:
int main() { using namespace std;
ifstream file("hello.gz", ios_base::in | ios_base::binary); io::filtering_istream in; in.push(io::gzip_decompressor()); in.push(file);
std::string stir;
in >> stir;
The >> operators work on a character basis... they dont work well on binary data. Try initializing your string differently and see if you have better luck (similarly later on in your example).

eg
The >> operators work on a character basis... they dont work well on binary data. Try initializing your string differently and see if you have better luck (similarly later on in your example).
this code works well...
#include <fstream>
#include <sstream>
#include

Now I have found out how to slove this problem. Thanks all!!!
participants (2)
-
CPPer
-
eg