POIFS tries to read in blocks of 512 bytes. This worked fine reading files from the filesystem, but causes trouble when reading Excel-files contained in a ZIP- file. ZipFile zip = new ZipFile(completePathToImportfile); Enumeration zipEntries = zip.entries(); ZipEntry zipEntry = (ZipEntry) zipEntries.nextElement(); InputStream innerFileStream = zip.getInputStream(zipEntry); POIFSFileSystem fs = new POIFSFileSystem(innerFileStream); // IOException occurs! Patch: The read() of java.io.InputStream does not guarantee to provide the full amount of requested bytes. It is necessary to repeat the reading until the full block is read or eof occured.
Created attachment 8798 [details] Patch for HeaderBlockReader.java
Created attachment 8799 [details] Patch of RawDataBlock.java
An equivalent patch has already been applied, but it did not make it into the 2.0pre3 release. Checkout the REL_2_BRANCH from CVS to get the latest version. *** This bug has been marked as a duplicate of 13478 ***