This is an automated email from the ASF dual-hosted git repository.
delei pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fesod.git
The following commit(s) were added to refs/heads/main by this push:
new 9a3201f1 fix: remove redundant buffer copy in
IoUtils.toByteArray(InputStream) (#963)
9a3201f1 is described below
commit 9a3201f1071a6cc1e30d4f9caa0f66614e3d1620
Author: Nikita Kuprins <[email protected]>
AuthorDate: Sat Jul 25 16:05:04 2026 +0300
fix: remove redundant buffer copy in IoUtils.toByteArray(InputStream) (#963)
---
.../src/main/java/org/apache/fesod/common/util/IoUtils.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git
a/fesod-common/src/main/java/org/apache/fesod/common/util/IoUtils.java
b/fesod-common/src/main/java/org/apache/fesod/common/util/IoUtils.java
index c3af9a0b..ded44ba0 100644
--- a/fesod-common/src/main/java/org/apache/fesod/common/util/IoUtils.java
+++ b/fesod-common/src/main/java/org/apache/fesod/common/util/IoUtils.java
@@ -53,12 +53,8 @@ public class IoUtils {
*/
public static byte[] toByteArray(final InputStream input) throws
IOException {
final ByteArrayOutputStream output = new ByteArrayOutputStream();
- try {
- copy(input, output);
- return output.toByteArray();
- } finally {
- output.toByteArray();
- }
+ copy(input, output);
+ return output.toByteArray();
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]