This class is the superclass of all classes that filter output streams. More...
#include <src/main/decaf/io/FilterOutputStream.h>

Public Member Functions | ||||
| FilterOutputStream (OutputStream *outputStream, bool own=false) | ||||
| Constructor, creates a wrapped output stream. | ||||
| virtual | ~FilterOutputStream () | |||
| virtual void | flush () | |||
Flushes this stream by writing any buffered output to the underlying stream.
| ||||
| virtual void | close () | |||
Closes this object and deallocates the appropriate resources.The object is generally no longer usable after calling close.
| ||||
| virtual std::string | toString () const | |||
Output a String representation of this object.The default version of this method just prints the Class Name.
| ||||
Protected Member Functions | ||||
| virtual void | doWriteByte (unsigned char value) | |||
| virtual void | doWriteArray (const unsigned char *buffer, int size) | |||
| virtual void | doWriteArrayBounded (const unsigned char *buffer, int size, int offset, int length) | |||
| virtual bool | isClosed () const | |||
Protected Attributes | ||||
| OutputStream * | outputStream | |||
| bool | own | |||
| volatile bool | closed | |||
This class is the superclass of all classes that filter output streams.
These streams sit on top of an already existing output stream (the underlying output stream) which it uses as its basic sink of data, but possibly transforming the data along the way or providing additional functionality.
The class FilterOutputStream itself simply overrides all methods of OutputStream with versions that pass all requests to the underlying output stream. Subclasses of FilterOutputStream may further override some of these methods as well as provide additional methods and fields.
Due to the lack of garbage collection in C++ a design decision was made to add a boolean parameter to the constructor indicating if the wrapped InputStream is owned by this object. That way creation of the underlying stream can occur in a Java like way. Ex:
DataOutputStream os = new DataOutputStream( new OutputStream(), true )
| decaf::io::FilterOutputStream::FilterOutputStream | ( | OutputStream * | outputStream, | |
| bool | own = false | |||
| ) |
Constructor, creates a wrapped output stream.
| outputStream | the OutputStream to wrap | |
| own | If true, this object will control the lifetime of the output stream that it encapsulates. |
| virtual decaf::io::FilterOutputStream::~FilterOutputStream | ( | ) | [virtual] |
| virtual void decaf::io::FilterOutputStream::close | ( | ) | [virtual] |
Closes this object and deallocates the appropriate resources.The object is generally no longer usable after calling close.
| IOException | if an error occurs while closing. |
The close method of FilterOutputStream calls its flush method, and then calls the close method of its underlying output stream.
Reimplemented from decaf::io::OutputStream.
Reimplemented in decaf::util::zip::DeflaterOutputStream.
| virtual void decaf::io::FilterOutputStream::doWriteArray | ( | const unsigned char * | buffer, | |
| int | size | |||
| ) | [protected, virtual] |
Reimplemented from decaf::io::OutputStream.
Reimplemented in decaf::io::BufferedOutputStream.
| virtual void decaf::io::FilterOutputStream::doWriteArrayBounded | ( | const unsigned char * | buffer, | |
| int | size, | |||
| int | offset, | |||
| int | length | |||
| ) | [protected, virtual] |
Reimplemented from decaf::io::OutputStream.
Reimplemented in activemq::io::LoggingOutputStream, decaf::io::BufferedOutputStream, decaf::io::DataOutputStream, decaf::util::zip::CheckedOutputStream, and decaf::util::zip::DeflaterOutputStream.
| virtual void decaf::io::FilterOutputStream::doWriteByte | ( | unsigned char | value | ) | [protected, virtual] |
| virtual void decaf::io::FilterOutputStream::flush | ( | ) | [virtual] |
Flushes this stream by writing any buffered output to the underlying stream.
| IOException | if an I/O error occurs. |
The flush method of FilterOutputStream calls the flush method of its underlying output stream.
Reimplemented from decaf::io::OutputStream.
Reimplemented in decaf::io::BufferedOutputStream.
| virtual bool decaf::io::FilterOutputStream::isClosed | ( | ) | const [protected, virtual] |
| virtual std::string decaf::io::FilterOutputStream::toString | ( | ) | const [virtual] |
Output a String representation of this object.The default version of this method just prints the Class Name.
The toString method of FilterOutputStream calls the toString method of its underlying output stream.
Reimplemented from decaf::io::OutputStream.
volatile bool decaf::io::FilterOutputStream::closed [protected] |
OutputStream* decaf::io::FilterOutputStream::outputStream [protected] |
bool decaf::io::FilterOutputStream::own [protected] |
1.6.1