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 0d9c4e5bc7d7c67720ac8ceba91c2bbfd4631fe9 Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Mon Aug 4 13:55:31 2025 -0400 Remove unused import --- .../apache/commons/compress/archivers/dump/TapeInputStream.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java b/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java index 937b66e9d..f516dc5f7 100644 --- a/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java @@ -27,7 +27,6 @@ import org.apache.commons.compress.MemoryLimitException; import org.apache.commons.compress.archivers.ArchiveException; -import org.apache.commons.compress.utils.ExactMath; import org.apache.commons.compress.utils.IOUtils; /** @@ -323,9 +322,7 @@ public long skip(final long len) throws IOException { if (len % RECORD_SIZE != 0) { throw new IllegalArgumentException("All reads must be multiple of record size (" + RECORD_SIZE + " bytes."); } - long bytes = 0; - while (bytes < len) { // we need to read from the underlying stream. // this will reset readOffset value. We do not perform @@ -338,9 +335,7 @@ public long skip(final long len) throws IOException { return -1; } } - long n = 0; - if (readOffset + (len - bytes) <= blockSize) { // we can read entirely from the buffer. n = len - bytes; @@ -348,12 +343,10 @@ public long skip(final long len) throws IOException { // copy what we can from the buffer. n = (long) blockSize - readOffset; } - // do not copy data but still increment counters. - readOffset = ExactMath.add(readOffset, n); + readOffset = ArchiveException.addExact(readOffset, n); bytes += n; } - return bytes; } }