title: csv to xls with more then 65536 lines in java
body: <p>I have a java program which reads in a csv file and converts it into a xls file:</p>
  
  <pre><code>String file2 = "myFile.csv";
  FileInputStream fis2 = new FileInputStream(file2);
  DataInputStream myInput2 = new DataInputStream(fis2);
  String thisLine;
  arList = new ArrayList();
  while ((thisLine = myInput2.readLine()) != null) {
  al = new ArrayList();
  String strar[] = thisLine.split(",");
  for (int j = 0; j &lt; strar.length; j++) {
         al.add(strar[j]);
  }
  arList.add(al);
  i++;
  }
  
  HSSFWorkbook hwb = new HSSFWorkbook();
  HSSFSheet sheet = hwb.createSheet("new sheet");
  
  for (int k = 0; k &lt; arList.size(); k++) {
  ArrayList ardata = (ArrayList) arList.get(k);
        HSSFRow row = sheet.createRow((short) 0 + k);
  
          for (int p = 0; p &lt; ardata.size(); p++) {
      HSSFCell cell = row.createCell((short) p);
      cell.setCellValue(ardata.get(p).toString());
       }
  }
  
  FileOutputStream fileOut = new FileOutputStream(file2.replace("csv", "xls"));
  hwb.write(fileOut);
  fileOut.close();
  myInput2.close();
  fis2.close();
  </code></pre>
  
  <p>However, I have a CSV with more then 65536 lines and thus above code is resulting in error. </p>
  
  <p>What could I do to above code to handle csv's with more then 65536 lines.</p>
  
  <p>Thanks for reading!</p>