i read about Apache WorkbookFactory
the guide are saying to close workbook when done. "Workbook should be closed after use"
but i dont have a close method to close it.
how could it be closed ?
Workbook wb = WorkbookFactory.create(tempFile);
wb.close();
i'm working with Apache poi Maven, version 3.9
The method close() is undefined for the type Workbook ... line 423 Java Problem
Note 1: that in order to properly release resources the Workbook should be closed after use.
Note 2: also that loading from an InputStream requires more memory than loading from a File
i would like to use a file and not an input stream like this one sayes
Workbook.close()
was implemented in poi 3.11 version.You have to close your output stream after work with workbook is done and it was written.
From POI user guide:
Don't forget to close workbook as well:
You need to close the
Workbook
, not its factory.Correct.
Untrue, unless the
InputStream
is aByteArrayInputStream
.