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