poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45582] org.apache.poi.hssf.record.RecordFormatException: Error reading bytes
Date Thu, 07 Aug 2008 20:44:34 GMT

Josh Micich <josh@gildedtree.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Josh Micich <josh@gildedtree.com>  2008-08-07 13:44:33 PST ---
Fixed in svn r683706.

The example file has one extra byte of data beyond the EOFRecord.  BTW - what
application produced this file?

POI always attempted to read the next record sid, without first checking for
stream.available().  This was wrong, seemed to work because another bug in
LittleEndian caused readShort() to return 0 when there were zero bytes
available.  All example spreadsheets up until now have had exactly zero bytes
data after the EOFRecord.  RecordInputStream was interpreting nextSid==0 as end
of stream.  This was also a little bit wrong, since 0x0000 *is* a valid Record
sid (from a previous Excel version).

RecordInputStream was changed to check the number of bytes left in the stream
before reading the next sid.  'End of stream' condition is now represented by
nextSid==-1 (a safer number). LittleEndian was modified to properly throw
BufferUnderrunException even for zero bytes read.  LittleEndian was also
changed to avoid creating temporary byte arrays just to read bytes, shorts,
ints and longs.

A junit test case was added using the sample file provided.

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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message