mirror of https://github.com/apache/poi.git
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:
parent
cbdf6d2330
commit
01e5666633
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue