From: Nick Burch Date: Thu, 21 Apr 2011 15:37:22 +0000 (+0000) Subject: Fix bug #51100 - Fix IOUtils issue for NPOIFS reading from an InputStream where every... X-Git-Tag: REL_3_8_BETA3~52 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8e0241ff83a8886f64fecd7ea052d450dbec5b78;p=poi.git 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 --- diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 45bd6658c6..f10d4d36eb 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 c3c8fa1ac9..d67bde2643 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; } }