java.lang

Interface Readable

public interface Readable

A Readable object is simply a source for Unicode character data. On request, a Readable will provide its data in a supplied CharBuffer.

Since: 1.5

Method Summary
intread(CharBuffer buf)
Adds the character data supplied by this Readable to the specified character buffer.

Method Detail

read

public int read(CharBuffer buf)
Adds the character data supplied by this Readable to the specified character buffer. This method simply places each character into the buffer as supplied, using put(), without flipping or rewinding.

Parameters: buf the buffer to place the character data in.

Returns: the number of char values placed in the buffer, or -1 if no more characters are available.

Throws: IOException if an I/O error occurs. NullPointerException if buf is null. ReadOnlyBufferException if buf is read only.