]> source.dussan.org Git - poi.git/commitdiff
Small fix for bug in RecordInputStream.readAllContinuedRemainder() introduced in...
authorJosh Micich <josh@apache.org>
Mon, 27 Oct 2008 23:44:44 +0000 (23:44 +0000)
committerJosh Micich <josh@apache.org>
Mon, 27 Oct 2008 23:44:44 +0000 (23:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@708385 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/record/RecordInputStream.java

index f9dd2c76c7d770694d87786c0ff78ad31211d4e0..b66bf0e96d4b4788206d94621548c39b5cd8c394 100755 (executable)
@@ -355,14 +355,14 @@ public final class RecordInputStream extends InputStream implements LittleEndian
     //growable array of the data.
     ByteArrayOutputStream out = new ByteArrayOutputStream(2*MAX_RECORD_DATA_SIZE);
 
-    while (isContinueNext()) {
+    while (true) {
       byte[] b = readRemainder();
       out.write(b, 0, b.length);
+      if (!isContinueNext()) {
+          break;
+      }
       nextRecord();
     }
-    byte[] b = readRemainder();
-    out.write(b, 0, b.length);
-
     return out.toByteArray();
   }