When I am trying to write data to excel sheet using apache poi which contains more than 64000 records, where SXSSF is used and I am getting the below error,
You can avoid zip bomb issues reading from an InputStream instead of reading from a File like this
File fp = new File(excelFile);
FileInputStream fpis = new FileInputStream(fp);
try {
wb = WorkbookFactory.create(fpis);
} finally {
fpis.close();
}
But be aware that the documentation at WorkbookFactory.create(java.io.InputStream) says that "loading from an InputStream requires more memory than loading from a File"