////////////// the ASCIIInputStream class ////////////////////// // This class is designed for the easy reading of strings // from a text file. Strings are assumed to be separated // by white space. private class ASCIIInputStream { private FileInputStream fis; public ASCIIInputStream(FileInputStream f) { fis=f; } public String readWord() throws IOException { int b=fis.read(); StringBuffer buff=new StringBuffer(30); int space=(int) ' '; while (b<=space) { if (b<0) throw new IOException(); b=fis.read(); } while (b>space) { buff.append((char) b); b=fis.read(); } return new String(buff); } private void close() throws IOException { fis.close(); } }