diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-08-12 17:46:17 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-08-12 17:46:17 +1000 |
commit | 7177df5df95c9fc0d2bc36340b948697980f00d3 (patch) | |
tree | 43e9115d1a87dabe743cf5092de56a8bb239e05a /source4/lib/zlib/contrib/iostream/test.cpp | |
parent | 5f873a4d8fbcd2eaeabb452ffba059338ed55dfc (diff) | |
parent | 0965b22ec561588201a3a79f1f1e316834c8ce0b (diff) | |
download | samba-7177df5df95c9fc0d2bc36340b948697980f00d3.tar.gz samba-7177df5df95c9fc0d2bc36340b948697980f00d3.tar.bz2 samba-7177df5df95c9fc0d2bc36340b948697980f00d3.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-local
(This used to be commit ce7b1424c711949e6feb0181d3759133b77391ff)
Diffstat (limited to 'source4/lib/zlib/contrib/iostream/test.cpp')
-rw-r--r-- | source4/lib/zlib/contrib/iostream/test.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source4/lib/zlib/contrib/iostream/test.cpp b/source4/lib/zlib/contrib/iostream/test.cpp new file mode 100644 index 0000000000..7d265b3b5c --- /dev/null +++ b/source4/lib/zlib/contrib/iostream/test.cpp @@ -0,0 +1,24 @@ + +#include "zfstream.h" + +int main() { + + // Construct a stream object with this filebuffer. Anything sent + // to this stream will go to standard out. + gzofstream os( 1, ios::out ); + + // This text is getting compressed and sent to stdout. + // To prove this, run 'test | zcat'. + os << "Hello, Mommy" << endl; + + os << setcompressionlevel( Z_NO_COMPRESSION ); + os << "hello, hello, hi, ho!" << endl; + + setcompressionlevel( os, Z_DEFAULT_COMPRESSION ) + << "I'm compressing again" << endl; + + os.close(); + + return 0; + +} |