activemq-cpp-3.6.0
decaf::io::DataOutputStream Class Reference

A data output stream lets an application write primitive Java data types to an output stream in a portable way. More...

#include <src/main/decaf/io/DataOutputStream.h>

Inheritance diagram for decaf::io::DataOutputStream:

Public Member Functions

 DataOutputStream (OutputStream *outputStream, bool own=false)
 Creates a new data output stream to write data to the specified underlying output stream.
virtual ~DataOutputStream ()
virtual long long size () const
 Returns the current value of the counter written, the number of bytes written to this data output stream so far.
virtual void writeBoolean (bool value)
 
virtual void writeByte (unsigned char value)
 
virtual void writeShort (short value)
 
virtual void writeUnsignedShort (unsigned short value)
 
virtual void writeChar (char value)
 
virtual void writeInt (int value)
 
virtual void writeLong (long long value)
 
virtual void writeFloat (float value)
 
virtual void writeDouble (double value)
 
virtual void writeBytes (const std::string &value)
 
virtual void writeChars (const std::string &value)
 
virtual void writeUTF (const std::string &value)
 
- 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

Protected Attributes

long long written
unsigned char buffer [8]
- Protected Attributes inherited from decaf::io::FilterOutputStream
OutputStreamoutputStream
bool own
volatile bool closed

Detailed Description

A data output stream lets an application write primitive Java data types to an output stream in a portable way.

An application can then use a data input stream to read the data back in.

Constructor & Destructor Documentation

decaf::io::DataOutputStream::DataOutputStream ( OutputStream outputStream,
bool  own = false 
)

Creates a new data output stream to write data to the specified underlying output stream.

Parameters
outputStreama stream to wrap with this one.
owntrue if this objects owns the stream that it wraps.
virtual decaf::io::DataOutputStream::~DataOutputStream ( )
virtual

Member Function Documentation

virtual void decaf::io::DataOutputStream::doWriteArrayBounded ( const unsigned char *  buffer,
int  size,
int  offset,
int  length 
)
protectedvirtual

Reimplemented from decaf::io::FilterOutputStream.

virtual void decaf::io::DataOutputStream::doWriteByte ( unsigned char  value)
protectedvirtual

Reimplemented from decaf::io::FilterOutputStream.

virtual long long decaf::io::DataOutputStream::size ( ) const
inlinevirtual

Returns the current value of the counter written, the number of bytes written to this data output stream so far.

If the counter overflows, it will be wrapped to decaf::lang::Long::MAX_VALUE.

Returns
the value of the written field.
virtual void decaf::io::DataOutputStream::writeBoolean ( bool  value)
virtual
virtual void decaf::io::DataOutputStream::writeByte ( unsigned char  value)
virtual

virtual void decaf::io::DataOutputStream::writeBytes ( const std::string &  value)
virtual

virtual void decaf::io::DataOutputStream::writeChar ( char  value)
virtual

virtual void decaf::io::DataOutputStream::writeChars ( const std::string &  value)
virtual

virtual void decaf::io::DataOutputStream::writeDouble ( double  value)
virtual

virtual void decaf::io::DataOutputStream::writeFloat ( float  value)
virtual

virtual void decaf::io::DataOutputStream::writeInt ( int  value)
virtual

virtual void decaf::io::DataOutputStream::writeLong ( long long  value)
virtual

virtual void decaf::io::DataOutputStream::writeUnsignedShort ( unsigned short  value)
virtual

virtual void decaf::io::DataOutputStream::writeUTF ( const std::string &  value)
virtual

Field Documentation

unsigned char decaf::io::DataOutputStream::buffer[8]
protected
long long decaf::io::DataOutputStream::written
protected

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