Following is the peace of code which i'm trying to read large excel sheet in to java level. This code works fine when my excel sheet input is small. But when I'm trying to read large excel sheet (size is about 5MB and 100000 records) it return a exception
java.io.IOException: inputstream is closed
try {
InputStream excelFile = new FileInputStream(excel);
XSSFWorkbook workbook =new XSSFWorkbook(excelFile);
if(excelFile!=null){
excelFile.close();
}
} catch (Exception e) {
e.printStackTrace();
}
what is the reason for that? Is there any alternative ways to read large excel sheets in Apache POI.