java.lang
Interface Readable

All Known Implementing Classes:
BufferedReader sample code for java.io.BufferedReader definition code for java.io.BufferedReader , CharArrayReader sample code for java.io.CharArrayReader definition code for java.io.CharArrayReader , CharBuffer sample code for java.nio.CharBuffer definition code for java.nio.CharBuffer , FileReader sample code for java.io.FileReader definition code for java.io.FileReader , FilterReader sample code for java.io.FilterReader definition code for java.io.FilterReader , InputStreamReader sample code for java.io.InputStreamReader definition code for java.io.InputStreamReader , LineNumberReader sample code for java.io.LineNumberReader definition code for java.io.LineNumberReader , PipedReader sample code for java.io.PipedReader definition code for java.io.PipedReader , PushbackReader sample code for java.io.PushbackReader definition code for java.io.PushbackReader , Reader sample code for java.io.Reader definition code for java.io.Reader , StringReader sample code for java.io.StringReader definition code for java.io.StringReader

public interface Readable

A Readable is a source of characters. Characters from a Readable are made available to callers of the read method via a CharBuffer sample code for java.nio.CharBuffer definition code for java.nio.CharBuffer .

Since:
1.5

Method Summary
 int read sample code for java.lang.Readable.read(java.nio.CharBuffer) definition code for java.lang.Readable.read(java.nio.CharBuffer) (CharBuffer sample code for java.nio.CharBuffer definition code for java.nio.CharBuffer  cb)
          Attempts to read characters into the specified character buffer.
 

Method Detail

read sample code for java.lang.Readable.read(java.nio.CharBuffer) definition code for java.lang.Readable.read(java.nio.CharBuffer)

int read(CharBuffer sample code for java.nio.CharBuffer definition code for java.nio.CharBuffer  cb)
         throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Attempts to read characters into the specified character buffer. The buffer is used as a repository of characters as-is: the only changes made are the results of a put operation. No flipping or rewinding of the buffer is performed.

Parameters:
cb - the buffer to read characters into
Returns:
@return The number of char values added to the buffer, or -1 if this source of characters is at its end
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if cb is null
ReadOnlyBufferException - if cb is a read only buffer