Chris@43: Chris@43: #include "zfstream.h" Chris@43: Chris@43: int main() { Chris@43: Chris@43: // Construct a stream object with this filebuffer. Anything sent Chris@43: // to this stream will go to standard out. Chris@43: gzofstream os( 1, ios::out ); Chris@43: Chris@43: // This text is getting compressed and sent to stdout. Chris@43: // To prove this, run 'test | zcat'. Chris@43: os << "Hello, Mommy" << endl; Chris@43: Chris@43: os << setcompressionlevel( Z_NO_COMPRESSION ); Chris@43: os << "hello, hello, hi, ho!" << endl; Chris@43: Chris@43: setcompressionlevel( os, Z_DEFAULT_COMPRESSION ) Chris@43: << "I'm compressing again" << endl; Chris@43: Chris@43: os.close(); Chris@43: Chris@43: return 0; Chris@43: Chris@43: }