code: protected PrintResult withOpenOutputStream(final PrintAction function) throws Exception {
          final File reportFile = getReportFile();
          final Processor.ExecutionContext executionContext;
          try (FileOutputStream out = new FileOutputStream(reportFile);
               BufferedOutputStream bout = new BufferedOutputStream(out)) {
              executionContext = function.run(bout);
          }
          return new PrintResult(reportFile.length(), executionContext);
      }
docs: Open an OutputStream and execute the function using the OutputStream.
  
  @param function the function to execute
  @return the URI and the file size