checkpoint
[sbp.git] / src / edu / berkeley / sbp / chr / CharInput.java
index 1178e42..530f25c 100644 (file)
@@ -8,23 +8,26 @@ import edu.berkeley.sbp.util.*;
 import edu.berkeley.sbp.misc.*;
 import edu.berkeley.sbp.Input.Location;
 
-public class CharInput extends CartesianInput<Character> {
+public class CharInput extends Cartesian.Input<Character> {
     private final Reader r;
     
     public CharInput(String s)                { this(new StringReader(s)); }
     public CharInput(Reader r)                { this(r, null); }
-    public CharInput(Reader r,      String s) { this.r = r; }
+    public CharInput(Reader r,      String s) { this.r = new BufferedReader(r); }
     public CharInput(InputStream i)           { this(i, null); }
     public CharInput(InputStream i, String s) { this(new InputStreamReader(i), s); }
     
     boolean cr = false;
+    private int count = 0;
     public boolean   isCR() { return cr; }
     public Character next() throws IOException {
         cr = false;
         int i = r.read();
-        if (i==-1) return null;
+        if (i==-1) { System.err.print("\r...done       \r"); return null; }
         char c = (char)i;
         cr = c=='\n';
+        if ((count++) % 100 == 0)
+         System.err.print("  " + count + "\r");
         return c;
     }
 }