import java.io.*;

class MyFileWriter
{

    private FileOutputStream output;
    public boolean fileIsOpen;
    
    public FileWriter()
    {
        fileIsOpen = false;
    }

    public void openFile(String outputFile) throws IOException
    {
        int i = 0;

        //open the file named inputFile
        try{
            output =  new FileOutputStream( outputFile );
            fileIsOpen = true;
        }
        catch (IOException e){
           return;
        }
    }
    
    public void writeByte(byte b) throws IOException
    {
        try
        {
            output.write( b );
        }
        catch ( IOException e )
        {
            throw e;
        }
    }
    
    public void closeFile() throws IOException
    {
        // close the file
        
        if ( output == null ) return;
        
        try{
            output.close();
            fileIsOpen = false;
        }
        catch( IOException e){
        }
    }

}
