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