Here is the error from reading an excel document: java.io.IOException: Invalid header signature; read 7888090397404325948, expecte d -2226271756974174256 at org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockRead er.java:88) at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSyste m.java:83) I have an excel document but not sure how to upload here...
Created attachment 12803 [details] excel file crashing on
What did you use to create this file? I've never seen this occur on a non-corrupt file before.
Created attachment 16573 [details] Invalid Header Test Case
I encountered the same type of problem while using the getBytes() of the HSSFWorkbook. From the Javadoc, Method getBytes - get the bytes of just the HSSF portions of the XLS file. Use this to construct a POI POIFSFileSystem yourself. However, when I feed it to to POIFSFileSystem I get the invalid header error. I've attached a VERY simple test case that create a workbook with a single sheet and it fails when using getBytes() but it will create a readable excel spreadsheet and can be contstructed using the ByteArrayOutputStream.toByeArray () method.
The attached file is XML not an XLS BIFF file (not a bug). The below question is an incorrect API usage formed as a bug but its really a question (which should be asked on the list).