From 01e566663347f358a8b10b16ec1f03e988d15a7d Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 12 Mar 2022 09:31:44 +0000 Subject: [PATCH] fix issue in IOUtils.toByteArrayWithMaxLength git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898871 13f79535-47bb-0310-9956-ffa450edef68 --- poi/src/main/java/org/apache/poi/util/IOUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poi/src/main/java/org/apache/poi/util/IOUtils.java b/poi/src/main/java/org/apache/poi/util/IOUtils.java index 34fac68a58..7e1fef8990 100644 --- a/poi/src/main/java/org/apache/poi/util/IOUtils.java +++ b/poi/src/main/java/org/apache/poi/util/IOUtils.java @@ -406,7 +406,7 @@ public final class IOUtils { long totalCount = 0; int readBytes = -1; do { - int todoBytes = (int)((limit < 0) ? buff.length : Math.min(limit-totalCount, buff.length)); + int todoBytes = (int)((limit < 0) ? DEFAULT_BUFFER_SIZE : Math.min(limit-totalCount, DEFAULT_BUFFER_SIZE)); if (todoBytes > 0) { readBytes = inp.read(buff, 0, todoBytes); if (readBytes > 0) {