- java.lang.Object
-
- de.haumacher.msgbuf.server.io.ReaderAdapter
-
- All Implemented Interfaces:
Reader
public final class ReaderAdapter extends Object implements Reader
- Author:
- Bernhard Haumacher
-
-
Constructor Summary
Constructors Constructor Description ReaderAdapter(Reader in)Creates aReaderAdapter.
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
ReaderAdapter
public ReaderAdapter(Reader in)
Creates aReaderAdapter.
-
-
Method Detail
-
read
public int read() throws IOExceptionDescription copied from interface:ReaderReads a single character.Subclasses that intend to support efficient single-character input should override this method.
- Specified by:
readin interfaceReader- 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
public int read(char[] cbuf, int off, int len) throws IOExceptionDescription copied from interface:ReaderReads characters into a portion of an array.- Specified by:
readin interfaceReader- 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
public void close() throws IOExceptionDescription copied from interface:ReaderCloses 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.- Specified by:
closein interfaceReader- Throws:
IOException- If an I/O error occurs
-
-