01: package markOccurrences;
02:
03: import java.io.IOException;
04: import java.nio.CharBuffer;
05:
06: public class TestAll extends Exception implements Readable {
07:
08: @Override
09: public String getMessage() {
10: return super .getMessage();
11: }
12:
13: public static final int KONST = 3;
14:
15: public TestAll() {
16: String s;
17: }
18:
19: public int read(CharBuffer cb) throws IOException {
20: if (cb == null)
21: throw new IOException("error");
22: int i = 0;
23: int count = 0;
24: LOOP: while (cb.charAt(i) == ' ') {
25: i++;
26: count++;
27: if (count > KONST)
28: break LOOP;
29: }
30: return 0;
31:
32: }
33:
34: }
|