fix issue in IOUtils.toByteArrayWithMaxLength

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898871 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-03-12 09:31:44 +00:00
parent cbdf6d2330
commit 01e5666633
1 changed files with 1 additions and 1 deletions

View File

@ -406,7 +406,7 @@ public final class IOUtils {
long totalCount = 0; long totalCount = 0;
int readBytes = -1; int readBytes = -1;
do { 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) { if (todoBytes > 0) {
readBytes = inp.read(buff, 0, todoBytes); readBytes = inp.read(buff, 0, todoBytes);
if (readBytes > 0) { if (readBytes > 0) {