This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new 867f03710ee CAMEL-19860: prevent creating unnecessary BufferedInputStream instances (#11382) 867f03710ee is described below commit 867f03710eec3cdef68559c207617927186b7e53 Author: Otavio Rodolfo Piske <orpi...@users.noreply.github.com> AuthorDate: Wed Sep 13 22:23:06 2023 +0200 CAMEL-19860: prevent creating unnecessary BufferedInputStream instances (#11382) --- .../main/java/org/apache/camel/dataformat/zipfile/ZipIterator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/camel-zipfile/src/main/java/org/apache/camel/dataformat/zipfile/ZipIterator.java b/components/camel-zipfile/src/main/java/org/apache/camel/dataformat/zipfile/ZipIterator.java index 7e791a242e9..33e152de845 100644 --- a/components/camel-zipfile/src/main/java/org/apache/camel/dataformat/zipfile/ZipIterator.java +++ b/components/camel-zipfile/src/main/java/org/apache/camel/dataformat/zipfile/ZipIterator.java @@ -55,7 +55,11 @@ public class ZipIterator implements Iterator<Message>, Closeable { if (inputStream instanceof ZipInputStream) { zipInputStream = (ZipInputStream) inputStream; } else { - zipInputStream = new ZipInputStream(new BufferedInputStream(inputStream)); + if (inputStream instanceof InputStream) { + zipInputStream = new ZipInputStream(inputStream); + } else { + zipInputStream = new ZipInputStream(new BufferedInputStream(inputStream)); + } } parent = null; first = true;