|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.io.Reader
Abstract class for reading character streams. The only methods that a subclass must implement are read(char[], int, int) and close().
| Field Summary | |
protected Lock |
lock
The object used to synchronize operations on this stream. |
| Constructor Summary | |
protected |
Reader()
|
protected |
Reader(Lock lock)
Create a new character-stream reader whose critical sections will synchronize on the given object. |
| Method Summary | |
abstract void |
close()
Close the stream. |
Lock |
getLock()
Get the Lock object used to synchronize IO operations on this Reader. |
void |
mark(int readLimit)
|
boolean |
markSupported()
|
int |
read()
Read a single character. |
int |
read(char[] cbuf)
Read characters into an array. |
abstract int |
read(char[] cbuf,
int off,
int len)
Read characters into a portion of an array. |
boolean |
ready()
Tell whether this stream is ready to be read. |
void |
reset()
|
long |
skip(long toSkip)
Skip over a certain number of characters. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
protected Lock lock
| Constructor Detail |
protected Reader()
protected Reader(Lock lock)
| Method Detail |
public Lock getLock()
public int read()
throws IOException
IOException - If an I/O error occurs
public int read(char[] cbuf)
throws IOException
cbuf - Destination buffer
IOException - If an I/O error occurs
public abstract int read(char[] cbuf,
int off,
int len)
throws IOException
cbuf - Destination bufferoff - Offset at which to start storing characterslen - Maximum number of characters to read
IOException - If an I/O error occurs
public long skip(long toSkip)
throws IOException
toSkip - the number of characters to skip over.
IOException - if an I/O error occurs while skipping.
public boolean ready()
throws IOException
IOException - If an I/O error occurspublic boolean markSupported()
public void mark(int readLimit)
throws IOException
IOException
public void reset()
throws IOException
IOException
public abstract void close()
throws IOException
IOException - If an I/O error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||