activemq-cpp-3.4.0

decaf::io::InputStreamReader Class Reference

An InputStreamReader is a bridge from byte streams to character streams. More...

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

Inheritance diagram for decaf::io::InputStreamReader:

Public Member Functions

 InputStreamReader (InputStream *stream, bool own=false)
 Create a new InputStreamReader that wraps the given InputStream.
virtual ~InputStreamReader ()
virtual void close ()
 Closes this object and deallocates the appropriate resources.
virtual bool ready () const
 Tells whether this stream is ready to be read.

Protected Member Functions

virtual int doReadArrayBounded (char *buffer, int size, int offset, int length)
 Override this method to customize the functionality of the method read( unsigned char* buffer, int size, int offset, int length ).
virtual void checkClosed () const

Detailed Description

An InputStreamReader is a bridge from byte streams to character streams.

For top efficiency, consider wrapping an InputStreamReader within a BufferedReader. For example:

BufferedReader* in = new BufferedReader( new InputStreamReader( System.in, false ), true );

See also:
OutputStreamWriter
Since:
1.0

Constructor & Destructor Documentation

decaf::io::InputStreamReader::InputStreamReader ( InputStream stream,
bool  own = false 
)

Create a new InputStreamReader that wraps the given InputStream.

Parameters:
streamThe InputStream to read from. (cannot be null).
ownDoes this object own the passed InputStream (defaults to false).
Exceptions:
NullPointerExceptionif the passed InputStream is NULL.
virtual decaf::io::InputStreamReader::~InputStreamReader ( ) [virtual]

Member Function Documentation

virtual void decaf::io::InputStreamReader::checkClosed ( ) const [protected, virtual]
virtual void decaf::io::InputStreamReader::close ( ) [virtual]

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.

Implements decaf::io::Closeable.

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

Override this method to customize the functionality of the method read( unsigned char* buffer, int size, int offset, int length ).

All subclasses must override this method to provide the basic Reader functionality.

Implements decaf::io::Reader.

virtual bool decaf::io::InputStreamReader::ready ( ) const [virtual]

Tells whether this stream is ready to be read.

Returns:
True if the next read() is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block.
Exceptions:
IOExceptionif an I/O error occurs.

Reimplemented from decaf::io::Reader.


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