Library: Foundation
Package: Streams
Header: Poco/DeflatingStream.h
This stream compresses all data passing through it using zlib's deflate algorithm. After all data has been written to the stream, close() must be called to ensure completion of compression. Example:
std::ofstream ostr("data.gz", std::ios::binary); DeflatingOutputStream deflater(ostr, DeflatingStreamBuf::STREAM_GZIP); deflater << "Hello, world!" << std::endl; deflater.close(); ostr.close();
Direct Base Classes: DeflatingIOS, std::ostream
All Base Classes: DeflatingIOS, std::ios, std::ostream
Inherited Functions: rdbuf
DeflatingOutputStream(
std::ostream & ostr,
DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB,
int level = (- 1)
);
Creates a DeflatingOutputStream for compressing data passed through and forwarding it to the given output stream.
DeflatingOutputStream(
std::ostream & ostr,
int windowBits,
int level
);
Creates a DeflatingOutputStream for compressing data passed through and forwarding it to the given output stream.
Please refer to the zlib documentation of deflateInit2() for a description of the windowBits parameter.
Destroys the DeflatingOutputStream.
int close();
Finishes up the stream.
Must be called when deflating to an output stream.
virtual int sync();