ppkarwasz commented on code in PR #710:
URL: https://github.com/apache/commons-compress/pull/710#discussion_r2390367781


##########
src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java:
##########
@@ -114,37 +95,56 @@ public Iterator<E> unwrap() {
     /** The number of bytes read in this stream. */
     private long bytesRead;
 
-    private Charset charset;
+    private final Charset charset;
+
+    private final int maxEntryNameLength;
 
     /**
      * Constructs a new instance.
      */
     @SuppressWarnings("resource")
     public ArchiveInputStream() {
-        this(new NullInputStream(), Charset.defaultCharset());
+        this(new NullInputStream(), Charset.defaultCharset().name());
     }
 
     /**
      * Constructs a new instance.
      *
      * @param inputStream the underlying input stream, or {@code null} if this 
instance is to be created without an underlying stream.
-     * @param charset charset.
+     * @param charsetName charset name.
+     * @since 1.26.0
+     */
+    protected ArchiveInputStream(final InputStream inputStream, final String 
charsetName) {
+        super(inputStream == null ? new NullInputStream() : inputStream);
+        this.charset = Charsets.toCharset(charsetName);
+        this.maxEntryNameLength = Short.MAX_VALUE;
+    }
+
+    /**
+     * Constructs a new instance from a builder.
+     *
+     * @param builder The builder.
      * @since 1.29.0
      */
-    protected ArchiveInputStream(final InputStream inputStream, final Charset 
charset) {
-        super(inputStream);
-        this.charset = Charsets.toCharset(charset);

Review Comment:
   Sure, `(InputStream, String)` should be deprecated. As of `(InputStream, 
Charset)` I took the liberty to remove it right away, since we haven't 
published it yet.



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