refactor IOUtils.toByteArray

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898291 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-02-21 23:31:58 +00:00
parent 8fc59014fe
commit ac56bc174e
1 changed files with 1 additions and 1 deletions

View File

@ -196,7 +196,7 @@ public final class IOUtils {
if (length < 0 || maxLength < 0) {
throw new RecordFormatException("Can't allocate an array of length < 0");
}
final int derivedMaxLength = BYTE_ARRAY_MAX_OVERRIDE <= 0 ? maxLength : Math.max(maxLength, BYTE_ARRAY_MAX_OVERRIDE);
final int derivedMaxLength = Math.max(maxLength, BYTE_ARRAY_MAX_OVERRIDE);
if ((length != Integer.MAX_VALUE) || (derivedMaxLength != Integer.MAX_VALUE)) {
checkLength(length, derivedMaxLength);
}