https://issues.apache.org/bugzilla/show_bug.cgi?id=45582
--- Comment #3 from James Perry <[EMAIL PROTECTED]> 2008-08-07 13:52:41 PST --- (In reply to comment #2) > 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. (In reply to comment #2) > 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. This file was created by Business Objects XI Update 2. Can you tell me (roughly) when this resolution will be available in a FINAL build? -- 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]
