Sva
Sva

Reputation: 115

Read using XSSF SAX and stream out data with SXSSF - POI

I have to read large sized xlsm with low memory footprint and since apache POI provides XSSF SAX, I should prefer using it. In the first sheet from existing xlsm parsed with SAX, i need to append some data from db and write it out as another xlsm. SXSSF provides streaming write and hence should combine both SAX read and SXSSF write. By this way i think heap size problem can be avoided for large size.

Is this possible using POI or are there any other approach ?
Kindly suggest me on this approach with any example !

Upvotes: 0

Views: 1606

Answers (1)

Robert Gannon
Robert Gannon

Reputation: 253

Based on the POI Spreadsheet Feature table, you cannot read files with SXSSF buffered streaming, although SXSSF buffered streaming does have the ability to write files.

My suggestion would be to read, parsing with SAX, using the XSSF eventmodel, and then write out using SXSSF buffered streaming to write the new file.

Upvotes: 1

Related Questions