1*44bedb31SLionel Sambuc 2*44bedb31SLionel Sambuc #include "zfstream.h" 3*44bedb31SLionel Sambuc main()4*44bedb31SLionel Sambucint main() { 5*44bedb31SLionel Sambuc 6*44bedb31SLionel Sambuc // Construct a stream object with this filebuffer. Anything sent 7*44bedb31SLionel Sambuc // to this stream will go to standard out. 8*44bedb31SLionel Sambuc gzofstream os( 1, ios::out ); 9*44bedb31SLionel Sambuc 10*44bedb31SLionel Sambuc // This text is getting compressed and sent to stdout. 11*44bedb31SLionel Sambuc // To prove this, run 'test | zcat'. 12*44bedb31SLionel Sambuc os << "Hello, Mommy" << endl; 13*44bedb31SLionel Sambuc 14*44bedb31SLionel Sambuc os << setcompressionlevel( Z_NO_COMPRESSION ); 15*44bedb31SLionel Sambuc os << "hello, hello, hi, ho!" << endl; 16*44bedb31SLionel Sambuc 17*44bedb31SLionel Sambuc setcompressionlevel( os, Z_DEFAULT_COMPRESSION ) 18*44bedb31SLionel Sambuc << "I'm compressing again" << endl; 19*44bedb31SLionel Sambuc 20*44bedb31SLionel Sambuc os.close(); 21*44bedb31SLionel Sambuc 22*44bedb31SLionel Sambuc return 0; 23*44bedb31SLionel Sambuc 24*44bedb31SLionel Sambuc } 25