An InputStreamReader is a bridge from byte streams to character streams.
More...
#include <src/main/decaf/io/InputStreamReader.h>
|
| 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.
|
|
virtual | ~Reader () |
|
virtual void | mark (int readAheadLimit) |
| Marks the present position in the stream.
|
|
virtual bool | markSupported () const |
| Tells whether this stream supports the mark() operation.
|
|
virtual void | reset () |
| Resets the stream.
|
|
virtual long long | skip (long long count) |
| Skips characters.
|
|
virtual int | read (std::vector< char > &buffer) |
| Reads characters into an array.
|
|
virtual int | read (char *buffer, int size) |
| Reads characters into an array, the method will attempt to read as much data as the size of the array.
|
|
virtual int | read (char *buffer, int size, int offset, int length) |
| Reads characters into a portion of an array.
|
|
virtual int | read () |
| Reads a single character.
|
|
virtual int | read (decaf::nio::CharBuffer *charBuffer) |
| Attempts to read characters into the specified character buffer.
|
|
virtual | ~Closeable () |
|
virtual | ~Readable () |
|
|
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 |
|
| Reader () |
|
virtual int | doReadVector (std::vector< char > &buffer) |
| Override this method to customize the functionality of the method read( std::vector<char>& buffer ).
|
|
virtual int | doReadArray (char *buffer, int length) |
| Override this method to customize the functionality of the method read( char* buffer, std::size_t length ).
|
|
virtual int | doReadChar () |
| Override this method to customize the functionality of the method read().
|
|
virtual int | doReadCharBuffer (decaf::nio::CharBuffer *charBuffer) |
| Override this method to customize the functionality of the method read( CharBuffer* charBuffer ).
|
|
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
◆ InputStreamReader()
decaf::io::InputStreamReader::InputStreamReader |
( |
InputStream * | stream, |
|
|
bool | own = false ) |
◆ ~InputStreamReader()
virtual decaf::io::InputStreamReader::~InputStreamReader |
( |
| ) |
|
|
virtual |
◆ checkClosed()
virtual void decaf::io::InputStreamReader::checkClosed |
( |
| ) |
const |
|
protectedvirtual |
◆ close()
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
-
Implements decaf::io::Closeable.
◆ doReadArrayBounded()
virtual int decaf::io::InputStreamReader::doReadArrayBounded |
( |
char * | buffer, |
|
|
int | size, |
|
|
int | offset, |
|
|
int | length ) |
|
protectedvirtual |
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.
◆ ready()
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
-
Reimplemented from decaf::io::Reader.
The documentation for this class was generated from the following file: