This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 6547b42c82b55bcee3da94b4a2507e0fa69b7633
Author: Matthieu Baechler <[email protected]>
AuthorDate: Wed Apr 15 22:50:02 2020 +0200

    [Refactoring] avoid using recursive SequenceInputStream
---
 .../main/java/org/apache/james/util/InputStreamUtils.java    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/server/container/util/src/main/java/org/apache/james/util/InputStreamUtils.java
 
b/server/container/util/src/main/java/org/apache/james/util/InputStreamUtils.java
index d522965..0d96591 100644
--- 
a/server/container/util/src/main/java/org/apache/james/util/InputStreamUtils.java
+++ 
b/server/container/util/src/main/java/org/apache/james/util/InputStreamUtils.java
@@ -21,14 +21,14 @@ package org.apache.james.util;
 
 import java.io.InputStream;
 import java.io.SequenceInputStream;
-import java.util.Arrays;
-import java.util.stream.Stream;
+import java.util.Collections;
+
+import com.google.common.collect.Lists;
 
 public class InputStreamUtils {
     public static InputStream concat(InputStream inputStream, InputStream... 
additionalInputStreams) {
-        Stream<InputStream> inputStreams = 
Stream.concat(Stream.of(inputStream), Arrays.stream(additionalInputStreams));
-
-        return inputStreams.reduce(SequenceInputStream::new)
-            .get();
+        return new SequenceInputStream(
+            Collections.enumeration(
+                Lists.asList(inputStream, additionalInputStreams)));
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to