|
CLDC 1.0 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.Reader
Abstract class for reading character streams. The only methods that a subclass must implement are read(char[], int, int) and close(). Most subclasses, however, will override some of the methods defined here in order to provide higher efficiency, additional functionality, or both.
InputStreamReader
,
Writer
Field Summary | |
protected Object |
lock
The object used to synchronize operations on this stream. |
Constructor Summary | |
protected |
Reader()
Create a new character-stream reader whose critical sections will synchronize on the reader itself. |
protected |
Reader(Object lock)
Create a new character-stream reader whose critical sections will synchronize on the given object. |
Method Summary | |
abstract void |
close()
Close the stream. |
void |
mark(int readAheadLimit)
Mark the present position in the stream. |
boolean |
markSupported()
Tell whether this stream supports the mark() operation. |
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()
Reset the stream. |
long |
skip(long n)
Skip characters. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected Object lock
Constructor Detail |
protected Reader()
protected Reader(Object lock)
lock
- The Object to synchronize on.Method Detail |
public int read() throws IOException
Subclasses that intend to support efficient single-character input should override this method.
public int read(char[] cbuf) throws IOException
cbuf
- Destination bufferpublic 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 readpublic long skip(long n) throws IOException
n
- The number of characters to skipn
is negative.public boolean ready() throws IOException
public boolean markSupported()
public void mark(int readAheadLimit) throws IOException
readAheadLimit
- Limit on the number of characters that may be
read while still preserving the mark. After
reading this many characters, attempting to
reset the stream may fail.public void reset() throws IOException
public abstract void close() throws IOException
|
Submit a bug or feature Copyright (c) 2000 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Portions may be derived from Berkeley BSD systems, licensed from U. of CA. Sun, Sun Microsystems, the Sun logo, Java, Java 2 MicroEdition, Connected Limited Device Configuration are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. andother countries. Federal Acquisitions:Commercial Software -Government Users Subject to Standard License Terms and Conditions. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |