This C ++ zlib cover library, of which I am the author, supports flash functionality and is probably easier to use:
https://github.com/rudi-cilibrasi/zlibcomplete
It is so simple:
#include <iostream>
#include <zlc/zlibcomplete.hpp>
using namespace zlibcomplete;
using namespace std;
int main(int argc, char **argv)
{
const int CHUNK = 16384;
char inbuf[CHUNK];
int readBytes;
ZLibCompressor compressor(9, auto_flush);
for (;;) {
cin.read(inbuf, CHUNK);
readBytes = cin.gcount();
if (readBytes == 0) {
break;
}
string input(inbuf, readBytes);
cout << compressor.compress(input);
}
cout << compressor.finish();
return 0;
}
boost , , , . ( auto_flush), . , . , , std::string, filtering_streambuf boost:: iostreams: copy. boost zlib , Z_SYNC_FLUSH. , , TCP. ++ ++, - .