X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2Fchr%2FCharInput.java;h=530f25c9b439f09f8ea97e05153c1610b84b056a;hp=795341800e312f42529b065bf255651dcb0acb8f;hb=38eb7943a4be918d46cb6517004e57ca91410ce0;hpb=e12a3098c6ed3cbfa6493870af3688f833c4f8ac diff --git a/src/edu/berkeley/sbp/chr/CharInput.java b/src/edu/berkeley/sbp/chr/CharInput.java index 7953418..530f25c 100644 --- a/src/edu/berkeley/sbp/chr/CharInput.java +++ b/src/edu/berkeley/sbp/chr/CharInput.java @@ -13,18 +13,21 @@ public class CharInput extends Cartesian.Input { 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; } }