- private static class Stream extends CartesianInput<Character> {
- private final Reader r;
-
- public Stream(String s) { this(new StringReader(s)); }
- public Stream(Reader r) { this(r, null); }
- public Stream(Reader r, String s) { this.r = r; }
- public Stream(InputStream i) { this(i, null); }
- public Stream(InputStream i, String s) { this(new InputStreamReader(i), s); }
-
- boolean cr = false;
- public boolean isCR() { return cr; }
- public Character next() throws IOException {
- cr = false;
- int i = r.read();
- if (i==-1) return null;
- char c = (char)i;
- cr = c=='\n';
- return c;
- }
- }