lantzen commented on code in PR #21249:
URL: https://github.com/apache/camel/pull/21249#discussion_r2769139278


##########
components/camel-zipfile/src/main/java/org/apache/camel/dataformat/zipfile/ZipIterator.java:
##########
@@ -143,10 +148,9 @@ private Message getNextElement() {
                         return getNextElement(); // skip directory
                     }
                 } else {
-                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                    IOHelper.copy(zipInputStream, baos);
-                    byte[] data = baos.toByteArray();
-                    answer.setBody(new ByteArrayInputStream(data));
+                    CachedOutputStream cos = new CachedOutputStream(exchange);

Review Comment:
   We tested with getting the 
[WrappedInputStream](https://github.com/apache/camel/blob/main/core/camel-support/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java#L134)
 from CachedOutputStream for it to close when the split ends but that doesn't 
seem to happen when we test it.
   
   Our main candidate now is to store references to the CachedOutputStreams in 
the ZipIterator and close then ZipIterator is closed, that seems to do the job 
if you are happy with that?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to