X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2Fchr%2FCharInput.java;h=a03f940820c20c43ce600432f3ffbe165d37a366;hp=2e8e8822fdbb97ecfb8c017af4dc452e0821ae45;hb=dcf8aafe73cbd899d8aebd2ef92df5a75a2c2b69;hpb=987a3f1d9ae796bb8db1294654125b07255128a5 diff --git a/src/edu/berkeley/sbp/chr/CharInput.java b/src/edu/berkeley/sbp/chr/CharInput.java index 2e8e882..a03f940 100644 --- a/src/edu/berkeley/sbp/chr/CharInput.java +++ b/src/edu/berkeley/sbp/chr/CharInput.java @@ -59,17 +59,23 @@ public class CharInput extends Cartesian.Input { private final RollbackReader r; - public CharInput(String s) { this(new StringReader(s)); } - public CharInput(Reader r) { this(r, null); } - public CharInput(Reader r, String s) { this.r = new RollbackReader(new BufferedReader(r)); } - public CharInput(InputStream i) { this(i, null); } - public CharInput(InputStream i, String s) { this(new InputStreamReader(i), s); } + public CharInput(Reader r, String s) { + this.name = s; + this.r = new RollbackReader(new BufferedReader(r)); + } + public CharInput(String s) { this(new StringReader(s)); } + public CharInput(Reader r) { this(r, null); } + public CharInput(InputStream i) { this(i, null); } + public CharInput(InputStream i, String s) { this(new InputStreamReader(i), s); } + public CharInput(File f) throws IOException { this(new FileInputStream(f), f.getName()); } public CharInput(InputStream i, String s, boolean indent) { this(new InputStreamReader(i), s); this.indent = indent; } + public String getName() { return name; } + private String name; boolean cr = false; boolean indent = false; private int count = 0;