https://bz.apache.org/bugzilla/show_bug.cgi?id=60217
Kostiantyn Miklevskyi <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW --- Comment #3 from Kostiantyn Miklevskyi <[email protected]> --- >Mark Murphy 2016-10-07 19:23:58 UTC >Can POI read the document after load/save? No, it throws an exception. Should've provided this info in initial report as I actually tried it. Here's a code: final POIDocument doc = new HWPFDocument(SaveToAnotherDocumentBug.class.getClassLoader().getResourceAsStream(DOCUMENT_NAME)); final File copy = new File(CORRUPTED_PREFIX + "-" + DOCUMENT_NAME); doc.write(copy); doc.close(); new HWPFDocument(new FileInputStream(copy)); And it throws with this stacktrace: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1845343745 at org.apache.poi.util.LittleEndian.getUByte(LittleEndian.java:274) at org.apache.poi.hwpf.model.FormattedDiskPage.<init>(FormattedDiskPage.java:61) at org.apache.poi.hwpf.model.PAPFormattedDiskPage.<init>(PAPFormattedDiskPage.java:85) at org.apache.poi.hwpf.model.PAPBinTable.<init>(PAPBinTable.java:75) at org.apache.poi.hwpf.HWPFDocument.<init>(HWPFDocument.java:226) at org.apache.poi.hwpf.HWPFDocument.<init>(HWPFDocument.java:157) at org.apache.poi.hwpf.HWPFDocument.<init>(HWPFDocument.java:145) at com.cosi.SaveToAnotherDocumentBug.main(SaveToAnotherDocumentBug.java:20) -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
