public static void writeFile(final File file,final FileOutput output,final IProgressMonitor monitor) throws CoreException {
  FileOutputStream fout=null;
  try {
    fout=new FileOutputStream(file);
    BufferedOutputStream bout=new BufferedOutputStream(fout);
    if (monitor != null) {
      monitor.subTask("writing data to " + file.getName());
    }
    output.writeFile(bout);
    bout.flush();
  }
 catch (  IOException e) {
    IStatus status=FindbugsPlugin.createErrorStatus("Exception while " + output.getTaskDescription(),e);
    throw new CoreException(status);
  }
 finally {
    closeQuietly(fout);
  }
}

public static void writeFile ( final File file , final FileOutput output , final IProgressMonitor monitor ) throws CoreException { FileOutputStream fout = null ; try { fout = new FileOutputStream ( file ) ; BufferedOutputStream bout = new BufferedOutputStream ( fout ) ; if ( monitor != null ) { monitor . subTask ( "writing data to " + file . getName ( ) ) ; } output . writeFile ( bout ) ; bout . flush ( ) ; } catch ( IOException e ) { IStatus status = FindbugsPlugin . createErrorStatus ( "Exception while " + output . getTaskDescription ( ) , e ) ; throw new CoreException ( status ) ; } finally { closeQuietly ( fout ) ; } }
write the contents of a java . io . file
