I have the following exception while creating a POIFSFileSystem from an InputStream. This is my code : public class Test() { InputStream ip = this.getClass().getClassLoader().getResourceAsStream(path); POIFSFileSystem fileSystem = new POIFSFileSystem(ip); HSSFWorkbook = new HSSFWorkbook(fileSystem); } java.io.IOException: Unable to read entire block; 1 byte read; expected 512 bytes at org.apache.poi.poifs.storage.RawDataBlock.<init> (RawDataBlock.java:98) at org.apache.poi.poifs.storage.RawDataBlockList.<init> (RawDataBlockList. java:88) at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init> (POIFSFileSystem .java:123)
The resource (xls file) is inside the jar file of the application. If the files in the jar file is compressed the just describe exception is throw. I try to keep the files in the jar file not compressed and no exception are throw. I think the problem come from the compression/decompression. Do you have a solution or it's a bug ? Tanks for your answer
Well, I imagine that sun's decompression utilities dont play very nicely with POI's input streams. I doubt we will support this. There is a fix in CVS for slow input streams (see bug 13478) which you can try by using latest CVS code or waiting for the next release. However, if that doesnt work, i honestly dont think this will be high priority.