Artifact 0074186cc98585f48eb8d18c2be887955238b741:
- File compat/zlib/contrib/iostream/test.cpp — part of check-in [8b8d3f1e88] at 2008-12-19 14:44:48 on branch trunk — Add previously omitted files so we have a complete zlib 1.2.3 distro... (user: dkf, size: 526) [annotate] [blame] [check-ins using] [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; }