Hello
the stacktrace is as follows:
Exception in thread "main" java.lang.RuntimeException: Buffer overrun
at
org.apache.poi.util.LittleEndianByteArrayOutputStream.checkPosition(LittleEndianByteArrayOutputStream.java:51)
at
org.apache.poi.util.LittleEndianByteArrayOutputStream.write(LittleEndianByteArrayOutputStream.java:88)
at
org.apache.poi.util.StringUtil.putCompressedUnicode(StringUtil.java:240)
at
org.apache.poi.util.StringUtil.writeUnicodeString(StringUtil.java:180)
at
org.apache.poi.hssf.record.LbsDataSubRecord.serialize(LbsDataSubRecord.java:223)
at org.apache.poi.hssf.record.ObjRecord.serialize(ObjRecord.java:185)
at
org.apache.poi.hssf.usermodel.HSSFWorkbook$SheetRecordCollector.serialize(HSSFWorkbook.java:1209)
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes(HSSFWorkbook.java:1258)
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:1158)
The modifications:
InputStream inp = new FileInputStream(filename);
Workbook wb = WorkbookFactory.create(inp);
Sheet s = wb.getSheetAt(0);
with this sheet i did:
for (int i=0;i<Headers.length-1;i++)
{ if (Correlation[i]<0) continue;
if (i==2) Contents[2] = Contents[1]+"; "+Contents[2];
Row r = Excelsheet.getRow(Correlation[i]-1);
Cell c = r.getCell(3);
int type = c.getCellType();
if (type==Cell.CELL_TYPE_STRING) c.setCellValue(Contents[i]);
if (type==Cell.CELL_TYPE_NUMERIC)
c.setCellValue(Double.parseDouble
(Contents[i].replace(",",".")));
}
FileOutputStream out = new FileOutputStream(filename);
wb.write(out); // here: Runtime exception (buffer overrun)
out.close();
I will have a look at bugzilla too,... i reduced the xls file so that only
the first sheet remained,
but the problem persisted.
kind regards
Olli
--
View this message in context:
http://old.nabble.com/buffer-overrun-with-certain-xls-file-tp27637833p27650960.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]