I have had success using a ByteArrayInputStream and adding null bytes to the array to make the total bytes divisible by 512 for POIFSFileSystem to work correctly...
On 9/25/07, Raymond Cheng <[EMAIL PROTECTED]> wrote: > I find a problem about reading excel file content. > > I have a excel file and I want to get its content by using POI. > From the following error description, I find that the excel content may > have some problem. > > Is any method for me to get more detail about this problem? > As a user point of view, I cannot know where is the block of data that > cannot be read. > It is more meaningful if the error can be described in terms of worksheet > or cell location. > > > fis = new FileInputStream(input); > fs = new POIFSFileSystem(fis); <-- error is found here > wb = new HSSFWorkbook(fs); > > > > java.io.IOException: Unable to read entire block; 72 bytes read; expected > 512 bytes > at org.apache.poi.poifs.storage.RawDataBlock.<init>( > RawDataBlock.java:62) > at org.apache.poi.poifs.storage.RawDataBlockList.<init>( > RawDataBlockList.java:51) > at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>( > POIFSFileSystem.java:86) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
