From c7bb2b5a151fd405a199e9b681c8c4eb30f0b5d0 Mon Sep 17 00:00:00 2001 From: Josh Micich Date: Mon, 27 Oct 2008 23:44:44 +0000 Subject: [PATCH] Small fix for bug in RecordInputStream.readAllContinuedRemainder() introduced in r707778. It seems like only BiffViewer was affected. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@708385 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/record/RecordInputStream.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/poi/hssf/record/RecordInputStream.java b/src/java/org/apache/poi/hssf/record/RecordInputStream.java index f9dd2c76c7..b66bf0e96d 100755 --- a/src/java/org/apache/poi/hssf/record/RecordInputStream.java +++ b/src/java/org/apache/poi/hssf/record/RecordInputStream.java @@ -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(); } -- 2.39.5