diff options
author | Eric Norum <WENorum@lbl.gov> | 2003-05-27 21:27:32 +0000 |
---|---|---|
committer | Eric Norum <WENorum@lbl.gov> | 2003-05-27 21:27:32 +0000 |
commit | 638e53ff239fdc0ae65d88dc196a507dd0642f14 (patch) | |
tree | 664e5dea7db53fc4b904c158f24f9fd5f22485fb /zlib-1.1.4/contrib/iostream/test.cpp | |
parent | b92d90caf1ed6f6a7c9edcfc873bad4efc7b750c (diff) |
Add zlib to RTEMS add-ons
Diffstat (limited to 'zlib-1.1.4/contrib/iostream/test.cpp')
-rw-r--r-- | zlib-1.1.4/contrib/iostream/test.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/zlib-1.1.4/contrib/iostream/test.cpp b/zlib-1.1.4/contrib/iostream/test.cpp new file mode 100644 index 0000000..7d265b3 --- /dev/null +++ b/zlib-1.1.4/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; + +} |