poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DRINKARD, JAMES E (SBCSI)" <jd4...@sbc.com>
Subject FW: Problem reading in a file
Date Tue, 11 Mar 2003 19:11:50 GMT
My code was correct where I was reading in the file. I missed code above
that point where I created a new file with 0 bytes. It didn't have any data
or a header, so I got the error.

-----Original Message-----
From: Danny Mui [mailto:danny@muibros.com]
Sent: Tuesday, March 11, 2003 12:01 PM
Subject: Re: Problem reading in a file

I got that error once before when the file I was reading was 0 bytes.  
Make sure the file does have something in it.



>Hello All,
>I'm trying to read in an excel file and I keep getting an error due to it
>not being able to read the header? I made the file using POI and then
>populated it with data. That part works fine. Then I try to read that file
>in order to change it using the following code:
>    {
>      POIFSFileSystem fs = new POIFSFileSystem(new
>  	  HSSFWorkbook wrkBk = new HSSFWorkbook(fs);
>fileName is a string variable with the filename and path: ie
>The error is:
>java.io.IOException: Unable to read entire header; -1 bytes read; expected
>512 bytes
>java.io.IOException: Unable to read entire header; -1 bytes read; expected
>512 bytes
>	at
>	at
>	at
>I know from other documentation I read that the header gets read first, so
>if it can't find it or interpret it, I assume this is the error one would
>Any ideas as to what I'm doing wrong?
>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: poi-user-help@jakarta.apache.org

View raw message