-
- All Known Implementing Classes:
ReaderAdapter,StringR
public interface ReaderA character stream reader.For compatibility with GWT, the native Java
Readerimplementation cannot be used.- See Also:
ReaderAdapter,StringR
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes the stream and releases any system resources associated with it.intread()Reads a single character.intread(char[] cbuf, int off, int len)Reads characters into a portion of an array.
-
-
-
Method Detail
-
read
int read() throws IOException
Reads a single character.Subclasses that intend to support efficient single-character input should override this method.
- Returns:
- The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached
- Throws:
IOException- If an I/O error occurs
-
read
int read(char[] cbuf, int off, int len) throws IOExceptionReads characters into a portion of an array.- Parameters:
cbuf- Destination bufferoff- Offset at which to start storing characterslen- Maximum number of characters to read- Returns:
- The number of characters read, or -1 if the end of the stream has been reached
- Throws:
IOException- If an I/O error occurs
-
close
void close() throws IOExceptionCloses the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw anIOException. Closing a previously closed stream has no effect.- Throws:
IOException- If an I/O error occurs
-
-