Code example for BufferedOutputStream

Methods: flush

0
        final File tempFile = File.createTempFile("report-designer-preview", ".rtf");//$NON-NLS-1$
        tempFile.deleteOnExit();
        final FileOutputStream fout = new FileOutputStream(tempFile);
        try 
        { 
          final BufferedOutputStream bout = new BufferedOutputStream(fout);
          final StreamRTFOutputProcessor target =
              new StreamRTFOutputProcessor(report.getConfiguration(), bout, report.getResourceManager());
          final StreamReportProcessor reportProcessor = new StreamReportProcessor(report, target);
 
          reportProcessor.addReportProgressListener(progressDialog);
          progressDialog.setVisibleInEDT(true);
 
          reportProcessor.processReport();
          reportProcessor.close();
          bout.flush();
          reportProcessor.removeReportProgressListener(progressDialog);
        } 
        finally 
        { 
          fout.close();