2 // submitted by Dalibor Topic <dtopic@socs.uts.edu.au>
6 public class ReaderTest {
7 public static void main(String [] args) {
8 Reader pr = new Reader() {
9 private int counter = 0;
10 public void close() throws IOException {
12 public int read(char buf[], int offset, int count)
14 if ((counter += count) >= 10000)
15 throw new IOException("enough");
22 } catch (IOException e) {
23 System.out.println(e.toString());
29 catch (IOException e) {
30 System.out.println(e.toString());
34 System.out.println(pr.ready());
35 } catch (IOException e) {
36 System.out.println(e.toString());
40 System.out.println(pr.skip(10000));
41 } catch (IOException e) {
42 System.out.println(e.toString());
48 java.io.IOException: mark() not supported
49 java.io.IOException: reset() not supported
51 java.io.IOException: enough