Bug 23326 - Exception while creating a POIFSFileSystem from an InputStream
Summary: Exception while creating a POIFSFileSystem from an InputStream
Status: RESOLVED WONTFIX
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 2.0-pre2
Hardware: PC All
: P3 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-22 11:26 UTC by Frédéric
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric 2003-09-22 11:26:40 UTC
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)
Comment 1 Frédéric 2003-09-22 11:34:37 UTC
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
Comment 2 Avik Sengupta 2003-10-06 10:36:01 UTC
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.