From 944109b369e9a14a2f8e3c6f0555be100e1b84cf Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 21 Apr 2011 15:37:22 +0000 Subject: [PATCH] Fix bug #51100 - Fix IOUtils issue for NPOIFS reading from an InputStream where every block is full git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1095753 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/status.xml | 1 + src/java/org/apache/poi/util/IOUtils.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 45bd6658c..f10d4d36e 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 51100 - Fix IOUtils issue for NPOIFS reading from an InputStream where every block is full 50956 - Correct XSSF cell style cloning between workbooks Add get/setForceFormulaRecalculation for XSSF, and promote the methods to the common usermodel Sheet Tweak the logic for sizing the HSSFCells array on a HSSFRow to reduce memory over allocation in many use cases diff --git a/src/java/org/apache/poi/util/IOUtils.java b/src/java/org/apache/poi/util/IOUtils.java index c3c8fa1ac..d67bde264 100644 --- a/src/java/org/apache/poi/util/IOUtils.java +++ b/src/java/org/apache/poi/util/IOUtils.java @@ -110,7 +110,7 @@ public final class IOUtils { return (total == 0) ? -1 : total; } total += got; - if (total == b.capacity()) { + if (total == b.capacity() || b.position() == b.capacity()) { return total; } }