Advertisement
alexandrecoussy

Untitled

May 9th, 2022
719
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. ByteArrayOutputStream byos = new ByteArrayOutputStream();
  2. // on remplit le ByteArrayOutputStream
  3.  
  4. workbook.write(byos);
  5. Path tempReportFile = Paths.get("report.xlsx");
  6. Path path = tempReportDir.resolve(tempReportFile);
  7.  
  8. try (OutputStream outputStream = Files.newOutputStream(path)) {
  9.   byos.writeTo(outputStream);
  10. }
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement