40 |
import java.io.IOException; |
import java.io.IOException; |
41 |
import java.nio.CharBuffer; |
import java.nio.CharBuffer; |
42 |
|
|
43 |
|
/** |
44 |
|
* A <code>Readable</code> object is simply a source for Unicode character |
45 |
|
* data. On request, a <code>Readable</code> will provide its data in |
46 |
|
* a supplied <code>CharBuffer</code>. |
47 |
|
* |
48 |
|
* @author Tom Tromey <tromey@redhat.com> |
49 |
|
* @author Andrew John Hughes <gnu_andrew@member.fsf.org> |
50 |
|
* @since 1.5 |
51 |
|
*/ |
52 |
public interface Readable |
public interface Readable |
53 |
{ |
{ |
54 |
|
|
55 |
|
/** |
56 |
|
* Adds the character data supplied by this <code>Readable</code> |
57 |
|
* to the specified character buffer. This method simply places |
58 |
|
* each character into the buffer as supplied, using <code>put()</code>, |
59 |
|
* without flipping or rewinding. |
60 |
|
* |
61 |
|
* @param buf the buffer to place the character data in. |
62 |
|
* @return the number of <code>char</code> values placed in the buffer, |
63 |
|
* or -1 if no more characters are available. |
64 |
|
* @throws IOException if an I/O error occurs. |
65 |
|
* @throws NullPointerException if buf is null. |
66 |
|
* @throws ReadOnlyBufferException if buf is read only. |
67 |
|
*/ |
68 |
int read(CharBuffer buf) throws IOException; |
int read(CharBuffer buf) throws IOException; |
69 |
|
|
70 |
} |
} |