import java.io.*;

class MyFileReader
{

    private FileInputStream input;
    
    public boolean fileIsOpen = false;

    public void openFile(String inputFile) throws IOException
    {

        //open the file named inputFile
        try{
            input =  new FileInputStream( inputFile );
            fileIsOpen = true;
        }
        catch (IOException e){
           throw new IOException(" Could not open encoded file ");
        }
    }
    
    public int readByte() throws IOException
    {
        int b;
        
        try
        {
            b = input.read();
        }
        catch ( IOException e )
        {
            throw new IOException(" Problem reading byte from file ");
        }
        return b;
    }
    

    public void closeFile() throws IOException
    {
        // close the file
        if ( input == null ) return;
        try
        {
            input.close();
            fileIsOpen = false;
        }
        catch( IOException e)
        {
            throw new IOException(" Problem closing file ");
        }
    }

}
