title: How to use POI SXSSF to read a large spreadsheet
body: <p>I am trying to read an xls file by using SXSSF. I have read about SXSSF, but do not understandexactly how to use it. So I am running into some problems. </p>
  
  <p>Can anybody help me with the java code for reading large xls files (some 100,000 rows and 7-8 sheets).</p>
  
  <p><strong>(Edit from the comments)</strong></p>
  
  <p>Here is what I have tried:</p>
  
  <pre><code>Workbook workBook = new SXSSFWorkbook(200); 
  workBook = WorkbookFactory.create(inputStream); 
  Sheet sheet = workBook.getSheetAt(0); 
  int totalRows = sheet.getPhysicalNumberOfRows(); 
  
  for (int i=0; i&lt;totalRows; i++) { 
      Row row = sheet.getRow(i); 
      int totalCols = row.getPhysicalNumberOfCells(); 
      for(int j=0; j&lt;totalCols; j++) { 
          Cell cell = row.getCell(j); 
      } 
   } 
  </code></pre>