Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
526 B

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