01: /*
02: * Created on Nov 11, 2005
03: */
04: package uk.org.ponder.streamutil.read;
05:
06: import java.io.IOException;
07:
08: /** A slimline, checked-exception-free INTERFACE replacing java.io.Reader */
09:
10: public interface ReadInputStream {
11: public static final char EOF = (char) -1;
12:
13: /** Reads a single character from the stream and returns it. If the stream
14: * has reached the end of file, return the value (char)-1.
15: * @return The character that was read.
16: * @throws IOException If a read error other than EOF occurs.
17: */
18: public char get();
19:
20: public int read(char[] target, int start, int length);
21:
22: /** Checks if end of the wrapped stream has been reached.
23: * @return <code>true</code> if the stream has reached the end of file.
24: */
25: public boolean EOF();
26:
27: /** A close method that will throw NO exception */
28: public void close();
29: }
|