activemq-cpp-3.6.0
decaf::util::zip::CheckedOutputStream Class Reference

An implementation of a FilterOutputStream that will maintain a Checksum of the bytes written, the Checksum can then be used to verify the integrity of the output stream. More...

#include <src/main/decaf/util/zip/CheckedOutputStream.h>

Inheritance diagram for decaf::util::zip::CheckedOutputStream:

Public Member Functions

 CheckedOutputStream (decaf::io::OutputStream *outputStream, Checksum *sum, bool own=false)
 Create a new instance of a CheckedOutputStream.
virtual ~CheckedOutputStream ()
ChecksumgetChecksum () const
- Public Member Functions inherited from decaf::io::FilterOutputStream
 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.
Exceptions
IOExceptionif an I/O error occurs.
The default implementation of this method does nothing.
virtual void close ()
 Closes this object and deallocates the appropriate resources.The object is generally no longer usable after calling close.
Exceptions
IOExceptionif an error occurs while closing.
The default implementation of this method does nothing.
virtual std::string toString () const
 Output a String representation of this object.The default version of this method just prints the Class Name.
Returns
a string representation of the object.

- Public Member Functions inherited from decaf::io::OutputStream
 OutputStream ()
virtual ~OutputStream ()
virtual void write (unsigned char c)
 Writes a single byte to the output stream.
virtual void write (const unsigned char *buffer, int size)
 Writes an array of bytes to the output stream.
virtual void write (const unsigned char *buffer, int size, int offset, int length)
 Writes an array of bytes to the output stream in order starting at buffer[offset] and proceeding until the number of bytes specified by the length argument are written or an error occurs.
virtual void lock ()
 Locks the object.
virtual bool tryLock ()
 Attempts to Lock the object, if the lock is already held by another thread than this method returns false.
virtual void unlock ()
 Unlocks the object.
virtual void wait ()
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void wait (long long millisecs)
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void wait (long long millisecs, int nanos)
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void notify ()
 Signals a waiter on this object that it can now wake up and continue.
virtual void notifyAll ()
 Signals the waiters on this object that it can now wake up and continue.
- Public Member Functions inherited from decaf::io::Closeable
virtual ~Closeable ()
- Public Member Functions inherited from decaf::io::Flushable
virtual ~Flushable ()
- Public Member Functions inherited from decaf::util::concurrent::Synchronizable
virtual ~Synchronizable ()

Protected Member Functions

virtual void doWriteByte (unsigned char value)
virtual void doWriteArrayBounded (const unsigned char *buffer, int size, int offset, int length)
- Protected Member Functions inherited from decaf::io::FilterOutputStream
virtual void doWriteArray (const unsigned char *buffer, int size)
virtual bool isClosed () const

Additional Inherited Members

- Protected Attributes inherited from decaf::io::FilterOutputStream
OutputStreamoutputStream
bool own
volatile bool closed

Detailed Description

An implementation of a FilterOutputStream that will maintain a Checksum of the bytes written, the Checksum can then be used to verify the integrity of the output stream.

Since
1.0

Constructor & Destructor Documentation

decaf::util::zip::CheckedOutputStream::CheckedOutputStream ( decaf::io::OutputStream outputStream,
Checksum sum,
bool  own = false 
)

Create a new instance of a CheckedOutputStream.

Parameters
outputStreamThe OutputStream instance to Wrap.
sumThe Checksum instance to use (does not take ownership of the Pointer).
ownIndicates if this filer should take ownership of the InputStream.
Exceptions
NullPointerExceptionif the Checksum pointer is NULL.
virtual decaf::util::zip::CheckedOutputStream::~CheckedOutputStream ( )
virtual

Member Function Documentation

virtual void decaf::util::zip::CheckedOutputStream::doWriteArrayBounded ( const unsigned char *  buffer,
int  size,
int  offset,
int  length 
)
protectedvirtual

Reimplemented from decaf::io::FilterOutputStream.

virtual void decaf::util::zip::CheckedOutputStream::doWriteByte ( unsigned char  value)
protectedvirtual

Reimplemented from decaf::io::FilterOutputStream.

Checksum* decaf::util::zip::CheckedOutputStream::getChecksum ( ) const
inline
Returns
a pointer to the Checksum instance in use by this object.

The documentation for this class was generated from the following file: