/* This class encapsulates streams of characters */ import java.util.*; import java.*; import java.io.*; public class FileReader{ public char sym; //The current character on the input, 0x00 = error, 0xff = EOF private BufferedReader in; private File f; // The constructor is complete however you can modify it based on your needs public FileReader(String fileName) //Constructor: Opens a file and reads the first character into 'sym' { char temp; try { f = new File(fileName); in = new BufferedReader(new InputStreamReader(new FileInputStream(f))); Next(); } catch(FileNotFoundException fnfe) { System.out.println("Can not find File:" + fileName); } catch (IOException ioe) { System.out.println("Can not preform IO operation correctly:" + ioe); } }//End of the constructor /////////////////////////// // The very basic stream operation of the method is mentioned here. // It's students assignment to complete this method or re-code it in their own way public void Next() { // To be completed by the students }//end of method Next /////////////////////////////////////////////////////////// public void Error(String ErrorMsg)//Signal an Error with current file position { // To be completed by the students } // End of method Error }//End of class