Artifact 0074186cc98585f48eb8d18c2be887955238b741:
- File compat/zlib/contrib/iostream/test.cpp — part of check-in [d17f4473cf] at 2012-11-27 06:31:19 on branch zlib — Support building with zlib in the compat directory, phase 1. (user: mistachkin size: 526) [more...]
#include "zfstream.h" int main() { // Construct a stream object with this filebuffer. Anything sent // to this stream will go to standard out. gzofstream os( 1, ios::out ); // This text is getting compressed and sent to stdout. // To prove this, run 'test | zcat'. os << "Hello, Mommy" << endl; os << setcompressionlevel( Z_NO_COMPRESSION ); os << "hello, hello, hi, ho!" << endl; setcompressionlevel( os, Z_DEFAULT_COMPRESSION ) << "I'm compressing again" << endl; os.close(); return 0; }