You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Alan Oshry <al...@gmail.com> on 2007/10/01 18:50:33 UTC

Re: Problem when I read a excel file "Unable to read entire block"

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 <ra...@hk-dttn.com> 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: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org