This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-io.git
commit 857a3d1bcb857085da90ce3b27d79dcdb84b3d04 Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Wed Aug 27 15:40:05 2025 -0400 Reduce vertical whitespace --- src/main/java/org/apache/commons/io/IOUtils.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/org/apache/commons/io/IOUtils.java b/src/main/java/org/apache/commons/io/IOUtils.java index 334b24fda..b9b7b63ab 100644 --- a/src/main/java/org/apache/commons/io/IOUtils.java +++ b/src/main/java/org/apache/commons/io/IOUtils.java @@ -2710,27 +2710,21 @@ public static byte[] toByteArray(final InputStream input, final long size) throw * @throws IllegalArgumentException if {@code size} is less than zero. */ static byte[] toByteArray(final IOTriFunction<byte[], Integer, Integer, Integer> input, final int size) throws IOException { - if (size < 0) { throw new IllegalArgumentException("Size must be equal or greater than zero: " + size); } - if (size == 0) { return EMPTY_BYTE_ARRAY; } - final byte[] data = byteArray(size); int offset = 0; int read; - while (offset < size && (read = input.apply(data, offset, size - offset)) != EOF) { offset += read; } - if (offset != size) { throw new IOException("Unexpected read size, current: " + offset + ", expected: " + size); } - return data; }