activemq::io::ByteArrayInputStream Class Reference

#include <ByteArrayInputStream.h>

Inheritance diagram for activemq::io::ByteArrayInputStream:

activemq::io::InputStream activemq::concurrent::Synchronizable List of all members.

Public Member Functions

 ByteArrayInputStream (void)
 ByteArrayInputStream (const unsigned char *buffer, int bufferSize)
virtual ~ByteArrayInputStream (void)
virtual void setByteArray (const unsigned char *buffer, int bufferSize)
virtual void lock () throw ( exceptions::ActiveMQException )
virtual void unlock () throw ( exceptions::ActiveMQException )
virtual void wait () throw ( exceptions::ActiveMQException )
virtual void wait (unsigned long millisecs) throw ( exceptions::ActiveMQException )
virtual void notify () throw ( exceptions::ActiveMQException )
virtual void notifyAll () throw ( exceptions::ActiveMQException )
virtual int available () const
virtual unsigned char read () throw ( IOException )
virtual int read (unsigned char *buffer, const int bufferSize) throw (IOException)
virtual void close () throw (cms::CMSException)

Private Attributes

std::vector< unsigned char > buffer
std::vector< unsigned char
>::const_iterator 
pos
concurrent::Mutex mutex

Constructor & Destructor Documentation

ByteArrayInputStream::ByteArrayInputStream void   ) 
 

Default Constructor

ByteArrayInputStream::ByteArrayInputStream const unsigned char *  buffer,
int  bufferSize
 

Constructor

Parameters:
buffer initial byte array to use to read from
bufferSize the size of the buffer

ByteArrayInputStream::~ByteArrayInputStream void   )  [virtual]
 


Member Function Documentation

virtual int activemq::io::ByteArrayInputStream::available  )  const [inline, virtual]
 

Indcates the number of bytes avaialable.

Returns:
the sum of the amount of data avalable in the buffer and the data available on the target input stream.

Implements activemq::io::InputStream.

void ByteArrayInputStream::close  )  throw (cms::CMSException) [virtual]
 

Closes the target input stream.

Exceptions:
IOException thrown if an error occurs.

virtual void activemq::io::ByteArrayInputStream::lock  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Waits on a signal from this object, which is generated by a call to Notify. Must have this object locked before calling.

Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.

virtual void activemq::io::ByteArrayInputStream::notify  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Signals a waiter on this object that it can now wake up and continue. Must have this object locked before calling.

Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.

virtual void activemq::io::ByteArrayInputStream::notifyAll  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Signals the waiters on this object that it can now wake up and continue. Must have this object locked before calling.

Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.

int ByteArrayInputStream::read unsigned char *  buffer,
const int  bufferSize
throw (IOException) [virtual]
 

Reads an array of bytes from the buffer.

Parameters:
buffer (out) the target buffer.
bufferSize the size of the output buffer.
Returns:
The number of bytes read.
Exceptions:
IOException thrown if an error occurs.

Implements activemq::io::InputStream.

unsigned char ByteArrayInputStream::read  )  throw ( IOException ) [virtual]
 

Reads a single byte from the buffer.

Returns:
The next byte.
Exceptions:
IOException thrown if an error occurs.

Implements activemq::io::InputStream.

void ByteArrayInputStream::setByteArray const unsigned char *  buffer,
int  bufferSize
[virtual]
 

Sets the data that this reader uses, replaces any existing data and resets to beginning of the buffer.

Parameters:
buffer initial byte array to use to read from
bufferSize the size of the buffer

virtual void activemq::io::ByteArrayInputStream::unlock  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Unlocks the object.

Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.

virtual void activemq::io::ByteArrayInputStream::wait unsigned long  millisecs  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Waits on a signal from this object, which is generated by a call to Notify. Must have this object locked before calling. This wait will timeout after the specified time interval.

Parameters:
millisecs the time in millisecsonds to wait, or WAIT_INIFINITE
Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.

virtual void activemq::io::ByteArrayInputStream::wait  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Waits on a signal from this object, which is generated by a call to Notify. Must have this object locked before calling.

Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.


Member Data Documentation

std::vector<unsigned char> activemq::io::ByteArrayInputStream::buffer [private]
 

The Array of Bytes to read from.

concurrent::Mutex activemq::io::ByteArrayInputStream::mutex [private]
 

Synchronization object.

std::vector<unsigned char>::const_iterator activemq::io::ByteArrayInputStream::pos [private]
 

iterator to current position in buffer.


The documentation for this class was generated from the following files:
Generated on Thu Aug 3 18:03:33 2006 for activemq-cpp by  doxygen 1.4.5