This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-compress.git
The following commit(s) were added to refs/heads/master by this push: new 0a97d74d Revert 0a97d74d is described below commit 0a97d74d1510475cb2cb3a45a2be857fa415e0a6 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Thu May 4 12:02:02 2023 -0400 Revert --- .../compress/archivers/zip/ExplodingInputStream.java | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ExplodingInputStream.java b/src/main/java/org/apache/commons/compress/archivers/zip/ExplodingInputStream.java index 77784602..31728b71 100644 --- a/src/main/java/org/apache/commons/compress/archivers/zip/ExplodingInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/zip/ExplodingInputStream.java @@ -19,7 +19,6 @@ package org.apache.commons.compress.archivers.zip; -import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; @@ -39,7 +38,10 @@ import org.apache.commons.compress.utils.InputStreamStatistics; * * @since 1.7 */ -class ExplodingInputStream extends FilterInputStream implements InputStreamStatistics { +class ExplodingInputStream extends InputStream implements InputStreamStatistics { + + /** The underlying stream containing the compressed data */ + private final InputStream in; /** The stream of bits read from the input stream */ private BitStream bits; @@ -69,7 +71,7 @@ class ExplodingInputStream extends FilterInputStream implements InputStreamStati private long treeSizes; /** - * Constructs a new stream decompressing the content of the specified stream + * Create a new stream decompressing the content of the specified stream * using the explode algorithm. * * @param dictionarySize the size of the sliding dictionary (4096 or 8192) @@ -77,7 +79,6 @@ class ExplodingInputStream extends FilterInputStream implements InputStreamStati * @param in the compressed data stream */ public ExplodingInputStream(final int dictionarySize, final int numberOfTrees, final InputStream in) { - super(in); if (dictionarySize != 4096 && dictionarySize != 8192) { throw new IllegalArgumentException("The dictionary size must be 4096 or 8192"); } @@ -87,10 +88,19 @@ class ExplodingInputStream extends FilterInputStream implements InputStreamStati this.dictionarySize = dictionarySize; this.numberOfTrees = numberOfTrees; this.minimumMatchLength = numberOfTrees; + this.in = in; + } + + /** + * @since 1.17 + */ + @Override + public void close() throws IOException { + in.close(); } /** - * Fills the sliding dictionary with more data. + * Fill the sliding dictionary with more data. * @throws IOException on error. */ private void fillBuffer() throws IOException {