Hi,

I adjusted this now so that _flush() is not called any more, unit-tests
indicate that writing multiple time works now for all three workbook-types
HSSF, XSSF and SXSSF.

Regards... Dominik.


On Thu, Jan 14, 2021 at 3:20 AM Rudolf Lenz <[email protected]> wrote:

> I called SXSSFWorkbook.write(OutputStream) twice with different
> outputStreams.
>
> The second call cause an exception:
>      at java.io.BufferedWriter.ensureOpen(BufferedWriter.java:116)
>      at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:126)
>      at java.io.BufferedWriter.flush(BufferedWriter.java:253)
>      at
>
> org.apache.poi.xssf.streaming.SheetDataWriter.close(SheetDataWriter.java:128)
>      at
>
> org.apache.poi.xssf.streaming.SXSSFSheet.getWorksheetXMLInputStream(SXSSFSheet.java:98)
>      at
>
> org.apache.poi.xssf.streaming.SXSSFWorkbook.injectData(SXSSFWorkbook.java:408)
>      at
> org.apache.poi.xssf.streaming.SXSSFWorkbook.write(SXSSFWorkbook.java:959)
>
> I suggest to delete  _out.flush();   in
> org.apache.poi.xssf.streaming.SheetDataWriter.close()
>
> The following  _out.close()   flushes anyway and does NOT cause an
> exception if  _out  is already closed by a previous SXSSFWorkbook.write().
>
> Kind regards
> Rudi
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to