Code example for BufferedWriter

Methods: close

0
                               final String encoding)
      throws ReportProcessingException, IOException 
  { 
    final CSVProcessor pr = new CSVProcessor(report);
    final FileOutputStream outstr = new FileOutputStream(filename);
    final Writer fout = new BufferedWriter(new OutputStreamWriter(outstr, encoding));
    pr.setWriter(fout);
    pr.processReport();
    fout.close();
  } 
 
  public static void createCSV(final MasterReport report,
                               final OutputStream outputStream,
                               final String encoding)
      throws ReportProcessingException, IOException 
  { 
    final CSVProcessor pr = new CSVProcessor(report);
    final Writer fout = new BufferedWriter(new OutputStreamWriter(outputStream, encoding));
    pr.setWriter(fout);
    pr.processReport();
    fout.flush();