/* * readMachine.java * * Created on December 8, 2002, 2:38 PM */ package JSE; import java.io.*; /** * * @author S */ public class ReadMachine { private DataInputStream input; private FileInputStream fis; private File file; private char c; /** Creates a new instance of readMachine */ public ReadMachine() { } public boolean openFile(String fname) { try { file = new File(fname); fis = new FileInputStream(file); input = new DataInputStream(fis); c = input.readChar(); return true; } catch (IOException e) { return false; } } public DataInputStream getInFile() { return input; } public boolean closeInputStream() { try{ input.close(); return true; } catch (IOException e) { return false; } } }