mirror of https://github.com/apache/poi.git
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:
parent
8fc59014fe
commit
ac56bc174e
|
@ -196,7 +196,7 @@ public final class IOUtils {
|
||||||
if (length < 0 || maxLength < 0) {
|
if (length < 0 || maxLength < 0) {
|
||||||
throw new RecordFormatException("Can't allocate an array of length < 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)) {
|
if ((length != Integer.MAX_VALUE) || (derivedMaxLength != Integer.MAX_VALUE)) {
|
||||||
checkLength(length, derivedMaxLength);
|
checkLength(length, derivedMaxLength);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue