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-imaging.git
commit c9400c9c239087576e56df8516af9d21f4c6f6b7 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Wed May 31 18:10:15 2023 -0400 Reuse IOUtils --- .../java/org/apache/commons/imaging/common/BinaryFunctions.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java b/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java index 53f37c09..1d8bffb5 100644 --- a/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java +++ b/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java @@ -16,10 +16,8 @@ */ package org.apache.commons.imaging.common; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; import java.io.PrintWriter; import java.io.RandomAccessFile; import java.nio.ByteOrder; @@ -94,9 +92,7 @@ public final class BinaryFunctions { } public static byte[] getStreamBytes(final InputStream is) throws IOException { - final ByteArrayOutputStream os = new ByteArrayOutputStream(); - IOUtils.copy(is, os); - return os.toByteArray(); + return IOUtils.toByteArray(is); } public static byte[] head(final byte[] bytes, int count) {