mehmet-karaman commented on code in PR #655:
URL: https://github.com/apache/commons-compress/pull/655#discussion_r2009100706


##########
src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java:
##########
@@ -167,7 +169,26 @@ public ZipFile get() throws IOException {
                 actualDescription = path.toString();
             }
             final boolean closeOnError = seekableByteChannel != null;
-            return new ZipFile(actualChannel, actualDescription, getCharset(), 
useUnicodeExtraFields, closeOnError, ignoreLocalFileHeader);
+            return new ZipFile(actualChannel, actualDescription, getCharset(), 
useUnicodeExtraFields, closeOnError, ignoreLocalFileHeader) {
+                @Override
+                protected InputStream createZstdInputStream(InputStream is) 
throws IOException {
+                    return zstdInputStream.apply(is);
+                }
+            };
+        }
+
+        /**
+         * @param zstdInpStreamFactory the IOFunction which gives the ability 
to return a different InputStream for Zstd compression.
+         * @return {@code this} instance
+         * @since 1.28.0
+         */
+        public Builder setZstdInputStreamFactory(IOFunction<InputStream, 
InputStream> zstdInpStreamFactory) {
+            if (zstdInpStreamFactory == null) {
+                this.zstdInputStream = ZstdCompressorInputStream::new;
+            } else {
+                this.zstdInputStream = zstdInpStreamFactory;

Review Comment:
   done.



-- 
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: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to