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


##########
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:
   the zip iterator should close it when its done, I would assume when itself 
is closed - the COS may spool to disk and therefore need to be closed so it can 
delete the temp file



-- 
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