https://issues.apache.org/bugzilla/show_bug.cgi?id=45582

           Summary: org.apache.poi.hssf.record.RecordFormatException: Error
                    reading bytes
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Created an attachment (id=22397)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22397)
Sample .xls file

I'm using the latest release of POI: poi-3.1-FINAL-20080629.jar
I have attached a sample .xls file, source, and exception.

Here is the sample code:
public class theApp {
    public static void main(String[] Args) {
        try {
            POIFSFileSystem fs = new POIFSFileSystem(new
FileInputStream("test-data.xls"));
            HSSFWorkbook wb = new HSSFWorkbook(fs);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


When attempting to open a .xls file I receive the following exception:

org.apache.poi.hssf.record.RecordFormatException: Error reading bytes
        at
org.apache.poi.hssf.record.RecordInputStream.nextRecord(RecordInputStream.java:115)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:123)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:246)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:169)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:151)
        at theApp.main(theApp.java:18)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: org.apache.poi.util.LittleEndian$BufferUnderrunException: buffer
underrun
        at
org.apache.poi.util.LittleEndian.readFromStream(LittleEndian.java:482)
        at org.apache.poi.util.LittleEndian.readShort(LittleEndian.java:414)
        at
org.apache.poi.hssf.record.RecordInputStream.nextRecord(RecordInputStream.java:113)
        ... 10 more


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to