decaf::io::BlockingByteArrayInputStream Class Reference

This is a blocking version of a byte buffer stream. More...

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

Inheritance diagram for decaf::io::BlockingByteArrayInputStream:
Inheritance graph
[legend]

Public Member Functions

 BlockingByteArrayInputStream ()
 Default Constructor - uses a default internal buffer.
 BlockingByteArrayInputStream (const unsigned char *buffer, int bufferSize)
 Constructor that initializes the internal buffer.
virtual ~BlockingByteArrayInputStream ()
virtual void setByteArray (const unsigned char *buffer, int bufferSize)
 
virtual int available () const
 Indicates the number of bytes available.The default implementation of this methods returns 0. Classes that override this method may return the total number of bytes that are currently available for reading and others may simply return a value of one indicating that there is some data avaiable. The caller should view the result of this method as an absolute.The default implementation of this method returns zero.
Returns:
the number of bytes available on this input stream.
Exceptions:
IOException if an I/O error occurs.

virtual void close ()
 Closes the InputStream freeing any resources that might have been acquired during the lifetime of this stream.The default implementation of this method does nothing.
Exceptions:
IOException if an I/O error occurs while closing the InputStream.

virtual long long skip (long long num)
 Skips over and discards n bytes of data from this input stream.The skip method may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly 0. This may result from any of a number of conditions; reaching end of file before n bytes have been skipped is only one possibility. The actual number of bytes skipped is returned.The skip method of InputStream creates a byte array and then repeatedly reads into it until num bytes have been read or the end of the stream has been reached. Subclasses are encouraged to provide a more efficient implementation of this method.
Parameters:
num The number of bytes to skip.
Returns:
total bytes skipped
Exceptions:
IOException if an I/O error occurs.
UnsupportedOperationException if the concrete stream class does not support skipping bytes.

Protected Member Functions

virtual int doReadByte ()
virtual int doReadArrayBounded (unsigned char *buffer, int size, int offset, int length)

Detailed Description

This is a blocking version of a byte buffer stream.

Read operations block until the requested data becomes available in the internal buffer via a call to setByteArray.


Constructor & Destructor Documentation

decaf::io::BlockingByteArrayInputStream::BlockingByteArrayInputStream (  ) 

Default Constructor - uses a default internal buffer.

decaf::io::BlockingByteArrayInputStream::BlockingByteArrayInputStream ( const unsigned char *  buffer,
int  bufferSize 
)

Constructor that initializes the internal buffer.

See also:
setByteArray.
virtual decaf::io::BlockingByteArrayInputStream::~BlockingByteArrayInputStream (  )  [virtual]

Member Function Documentation

virtual int decaf::io::BlockingByteArrayInputStream::available (  )  const [virtual]

Indicates the number of bytes available.The default implementation of this methods returns 0. Classes that override this method may return the total number of bytes that are currently available for reading and others may simply return a value of one indicating that there is some data avaiable. The caller should view the result of this method as an absolute.The default implementation of this method returns zero.

Returns:
the number of bytes available on this input stream.
Exceptions:
IOException if an I/O error occurs.

Reimplemented from decaf::io::InputStream.

virtual void decaf::io::BlockingByteArrayInputStream::close (  )  [virtual]

Closes the InputStream freeing any resources that might have been acquired during the lifetime of this stream.The default implementation of this method does nothing.

Exceptions:
IOException if an I/O error occurs while closing the InputStream.

Reimplemented from decaf::io::InputStream.

virtual int decaf::io::BlockingByteArrayInputStream::doReadArrayBounded ( unsigned char *  buffer,
int  size,
int  offset,
int  length 
) [protected, virtual]

Reimplemented from decaf::io::InputStream.

virtual int decaf::io::BlockingByteArrayInputStream::doReadByte (  )  [protected, virtual]
virtual void decaf::io::BlockingByteArrayInputStream::setByteArray ( const unsigned char *  buffer,
int  bufferSize 
) [virtual]

virtual long long decaf::io::BlockingByteArrayInputStream::skip ( long long  num  )  [virtual]

Skips over and discards n bytes of data from this input stream.The skip method may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly 0. This may result from any of a number of conditions; reaching end of file before n bytes have been skipped is only one possibility. The actual number of bytes skipped is returned.The skip method of InputStream creates a byte array and then repeatedly reads into it until num bytes have been read or the end of the stream has been reached. Subclasses are encouraged to provide a more efficient implementation of this method.

Parameters:
num The number of bytes to skip.
Returns:
total bytes skipped
Exceptions:
IOException if an I/O error occurs.
UnsupportedOperationException if the concrete stream class does not support skipping bytes.

Reimplemented from decaf::io::InputStream.


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

Generated on 1 Dec 2014 for activemq-cpp-3.8.2 by  doxygen 1.6.1