|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.io.Reader
ewe.io.StringReader
This class permits a String to be read as a character
input stream.
The mark/reset functionality in this class behaves differently than
normal. If no mark has been set, then calling the reset()
method rewinds the read pointer to the beginning of the String.
| Field Summary |
| Fields inherited from class ewe.io.Reader |
lock |
| Constructor Summary | |
StringReader(String buffer)
Create a new StringReader that will read chars from the
passed in String. |
|
| Method Summary | |
void |
close()
Close the stream. |
void |
mark(int readAheadLimit)
|
boolean |
markSupported()
|
int |
read()
Read a single character. |
int |
read(char[] b,
int off,
int len)
Read characters into a portion of an array. |
boolean |
ready()
This method determines if the stream is ready to be read. |
void |
reset()
Sets the read position in the stream to the previously marked position or to 0 (i.e., the beginning of the stream) if the mark has not already been set. |
long |
skip(long n)
This method attempts to skip the requested number of chars in the input stream. |
| Methods inherited from class ewe.io.Reader |
getLock, read |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Constructor Detail |
public StringReader(String buffer)
StringReader that will read chars from the
passed in String. This stream will read from the beginning
to the end of the String.
| Method Detail |
public void close()
Reader
close in class Reader
public void mark(int readAheadLimit)
throws IOException
mark in class ReaderIOExceptionpublic boolean markSupported()
markSupported in class Reader
public int read()
throws IOException
Reader
read in class ReaderIOException - If an I/O error occurs
public int read(char[] b,
int off,
int len)
throws IOException
Reader
read in class Readerb - Destination bufferoff - Offset at which to start storing characterslen - Maximum number of characters to read
IOException - If an I/O error occurs
public boolean ready()
throws IOException
true, unless
close() has previously been called in which case an IOException is
thrown.
ready in class Readertrue to indicate that this object is ready to be read.
IOException - If the stream is closed.
public void reset()
throws IOException
reset in class ReaderIOException
public long skip(long n)
throws IOException
pos value by
the specified number of chars. It this would exceed the length of the
buffer, then only enough chars are skipped to position the stream at
the end of the buffer. The actual number of chars skipped is returned.
skip in class Readern - the number of characters to skip over.
IOException - if an I/O error occurs while skipping.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||