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
commit 94e4d6ab4e7de29f22ff0e071dbed7879fee1caf Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Fri Jul 5 09:11:00 2024 -0400 Migrate from deprecated API --- .../compress/compressors/brotli/BrotliCompressorInputStream.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStream.java index 8ba5f0a1c..0b5621f14 100644 --- a/src/main/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStream.java @@ -23,7 +23,7 @@ import java.io.InputStream; import org.apache.commons.compress.compressors.CompressorInputStream; import org.apache.commons.compress.utils.InputStreamStatistics; import org.apache.commons.io.IOUtils; -import org.apache.commons.io.input.CountingInputStream; +import org.apache.commons.io.input.BoundedInputStream; import org.brotli.dec.BrotliInputStream; /** @@ -33,11 +33,11 @@ import org.brotli.dec.BrotliInputStream; */ public class BrotliCompressorInputStream extends CompressorInputStream implements InputStreamStatistics { - private final CountingInputStream countingInputStream; + private final BoundedInputStream countingInputStream; private final BrotliInputStream brotliInputStream; public BrotliCompressorInputStream(final InputStream inputStream) throws IOException { - brotliInputStream = new BrotliInputStream(countingInputStream = new CountingInputStream(inputStream)); + brotliInputStream = new BrotliInputStream(countingInputStream = BoundedInputStream.builder().setInputStream(inputStream).get()); } @Override @@ -55,7 +55,7 @@ public class BrotliCompressorInputStream extends CompressorInputStream implement */ @Override public long getCompressedCount() { - return countingInputStream.getByteCount(); + return countingInputStream.getCount(); } @Override