You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/12/21 22:19:42 UTC

(commons-compress) branch master updated (0c9f16e43 -> 87a96f1c7)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


    from 0c9f16e43 Javadoc
     new 856a540d3 Resue commons-io
     new 97078adb4 Reuse Arrays.equals(byte[], byte[]) and deprecate ArchiveUtils.isEqual(byte[], byte[])
     new de471d6e7 Javadoc spelling
     new 87a96f1c7 Javadoc spelling

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml                                            |  2 +-
 src/changes/changes.xml                            |  3 +
 .../archivers/ar/ArArchiveInputStream.java         |  2 +-
 .../archivers/arj/ArjArchiveInputStream.java       |  5 +-
 .../compress/archivers/examples/Expander.java      |  3 +-
 .../compress/archivers/sevenz/SevenZFile.java      |  2 +-
 .../archivers/sevenz/SevenZOutputFile.java         |  6 +-
 .../archivers/tar/TarArchiveInputStream.java       |  8 +-
 .../archivers/tar/TarArchiveOutputStream.java      |  4 +-
 .../commons/compress/archivers/tar/TarUtils.java   |  2 +-
 .../compress/archivers/zip/AsiExtraField.java      |  2 +-
 .../archivers/zip/ExplodingInputStream.java        |  8 +-
 .../compress/archivers/zip/X7875_NewUnix.java      |  4 +-
 .../archivers/zip/ZipArchiveInputStream.java       |  3 +-
 .../archivers/zip/ZipArchiveOutputStream.java      |  5 +-
 .../archivers/zip/ZipEightByteInteger.java         | 14 ++--
 .../compress/archivers/zip/ZipEncodingHelper.java  |  2 +-
 .../commons/compress/archivers/zip/ZipFile.java    | 10 +--
 .../commons/compress/archivers/zip/ZipLong.java    | 12 +--
 .../commons/compress/archivers/zip/ZipShort.java   | 12 +--
 .../compress/changes/ChangeSetPerformer.java       |  3 +-
 .../brotli/BrotliCompressorInputStream.java        |  7 +-
 .../bzip2/BZip2CompressorInputStream.java          |  4 +-
 .../deflate/DeflateCompressorInputStream.java      |  7 +-
 .../deflate64/Deflate64CompressorInputStream.java  |  6 +-
 .../gzip/GzipCompressorInputStream.java            |  7 +-
 .../lz4/FramedLZ4CompressorInputStream.java        |  6 +-
 .../AbstractLZ77CompressorInputStream.java         |  4 +-
 .../lzma/LZMACompressorInputStream.java            |  7 +-
 .../pack200/Pack200CompressorInputStream.java      |  7 +-
 .../snappy/FramedSnappyCompressorInputStream.java  |  6 +-
 .../compressors/xz/XZCompressorInputStream.java    |  7 +-
 .../zstandard/ZstdCompressorInputStream.java       |  7 +-
 .../commons/compress/utils/ArchiveUtils.java       |  4 +-
 .../commons/compress/utils/BitInputStream.java     |  7 +-
 .../apache/commons/compress/utils/ByteUtils.java   | 18 ++---
 .../apache/commons/compress/utils/Charsets.java    |  2 +
 .../utils/CloseShieldFilterInputStream.java        |  4 +
 .../compress/utils/CountingInputStream.java        |  2 +
 .../compress/utils/CountingOutputStream.java       |  2 +
 .../org/apache/commons/compress/utils/IOUtils.java | 90 +++++++---------------
 .../org/apache/commons/compress/OsgiITest.java     |  1 +
 .../apache/commons/compress/utils/IOUtilsTest.java |  4 +-
 43 files changed, 147 insertions(+), 174 deletions(-)


(commons-compress) 01/04: Resue commons-io

Posted by gg...@apache.org.
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 856a540d3eeb463527c509853f4d205f4adc272f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 21 16:21:52 2023 -0500

    Resue commons-io
---
 pom.xml                                            |  2 +-
 src/changes/changes.xml                            |  2 +
 .../archivers/ar/ArArchiveInputStream.java         |  2 +-
 .../archivers/arj/ArjArchiveInputStream.java       |  5 +-
 .../compress/archivers/examples/Expander.java      |  3 +-
 .../compress/archivers/sevenz/SevenZFile.java      |  2 +-
 .../archivers/sevenz/SevenZOutputFile.java         |  6 +-
 .../archivers/tar/TarArchiveInputStream.java       |  8 +-
 .../archivers/tar/TarArchiveOutputStream.java      |  4 +-
 .../commons/compress/archivers/tar/TarUtils.java   |  2 +-
 .../archivers/zip/ExplodingInputStream.java        |  8 +-
 .../archivers/zip/ZipArchiveInputStream.java       |  3 +-
 .../archivers/zip/ZipArchiveOutputStream.java      |  5 +-
 .../compress/archivers/zip/ZipEncodingHelper.java  |  2 +-
 .../commons/compress/archivers/zip/ZipFile.java    | 10 +--
 .../compress/changes/ChangeSetPerformer.java       |  3 +-
 .../brotli/BrotliCompressorInputStream.java        |  7 +-
 .../bzip2/BZip2CompressorInputStream.java          |  4 +-
 .../deflate/DeflateCompressorInputStream.java      |  7 +-
 .../deflate64/Deflate64CompressorInputStream.java  |  6 +-
 .../gzip/GzipCompressorInputStream.java            |  7 +-
 .../lz4/FramedLZ4CompressorInputStream.java        |  6 +-
 .../AbstractLZ77CompressorInputStream.java         |  4 +-
 .../lzma/LZMACompressorInputStream.java            |  7 +-
 .../pack200/Pack200CompressorInputStream.java      |  7 +-
 .../snappy/FramedSnappyCompressorInputStream.java  |  6 +-
 .../compressors/xz/XZCompressorInputStream.java    |  7 +-
 .../zstandard/ZstdCompressorInputStream.java       |  7 +-
 .../commons/compress/utils/BitInputStream.java     |  7 +-
 .../apache/commons/compress/utils/Charsets.java    |  2 +
 .../utils/CloseShieldFilterInputStream.java        |  4 +
 .../compress/utils/CountingInputStream.java        |  2 +
 .../compress/utils/CountingOutputStream.java       |  2 +
 .../org/apache/commons/compress/utils/IOUtils.java | 90 +++++++---------------
 .../org/apache/commons/compress/OsgiITest.java     |  1 +
 .../apache/commons/compress/utils/IOUtilsTest.java |  4 +-
 36 files changed, 112 insertions(+), 142 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7366c335e..1d4ca25df 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,6 +62,7 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
       org.objectweb.asm;resolution:=optional,
       javax.crypto.*;resolution:=optional,
       org.apache.commons.commons-codec;resolution:=optional,
+      org.apache.commons.commons-io;resolution:=optional,
       *
     </commons.osgi.import>
 
@@ -204,7 +205,6 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
       <version>2.15.1</version>
-      <scope>test</scope>
     </dependency>    
     <dependency>
       <groupId>org.apache.commons</groupId>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 60ae444e4..5774f5178 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -54,6 +54,8 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate SkipShieldingInputStream without replacement (no longer used).</action>
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse commons-codec, don't duplicate class PureJavaCrc32C (removed package-private class).</action>
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse commons-codec, don't duplicate class XXHash32 (deprecated class).</action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse commons-io, don't duplicate class Charsets (deprecated class).</action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse commons-io, don't duplicate class IOUtils (deprecated class).</action>
       <action type="fix" dev="ggregory" due-to="alumi, Gary Gregory">Add a null-check for the class loader of OsgiUtils #451.</action>
       <action type="fix" dev="ggregory" due-to="alumi, Gary Gregory">Add a null-check in Pack200.newInstance(String, String).</action>
       <!--  UPDATE -->
diff --git a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
index e2f55aa28..9361801de 100644
--- a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
@@ -251,7 +251,7 @@ public class ArArchiveInputStream extends ArchiveInputStream<ArArchiveEntry> {
     public ArArchiveEntry getNextArEntry() throws IOException {
         if (currentEntry != null) {
             final long entryEnd = entryOffset + currentEntry.getLength();
-            final long skipped = IOUtils.skip(input, entryEnd - offset);
+            final long skipped = org.apache.commons.io.IOUtils.skip(input, entryEnd - offset);
             trackReadBytes(skipped);
             currentEntry = null;
         }
diff --git a/src/main/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStream.java
index e8d89bfdd..79f7de9a1 100644
--- a/src/main/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStream.java
@@ -30,8 +30,8 @@ import org.apache.commons.compress.archivers.ArchiveException;
 import org.apache.commons.compress.archivers.ArchiveInputStream;
 import org.apache.commons.compress.utils.BoundedInputStream;
 import org.apache.commons.compress.utils.CRC32VerifyingInputStream;
-import org.apache.commons.compress.utils.Charsets;
 import org.apache.commons.compress.utils.IOUtils;
+import org.apache.commons.io.Charsets;
 
 /**
  * Implements the "arj" archive format as an InputStream.
@@ -129,7 +129,8 @@ public class ArjArchiveInputStream extends ArchiveInputStream<ArjArchiveEntry> {
     public ArjArchiveEntry getNextEntry() throws IOException {
         if (currentInputStream != null) {
             // return value ignored as IOUtils.skip ensures the stream is drained completely
-            IOUtils.skip(currentInputStream, Long.MAX_VALUE);
+            final InputStream input = currentInputStream;
+            org.apache.commons.io.IOUtils.skip(input, Long.MAX_VALUE);
             currentInputStream.close();
             currentLocalFileHeader = null;
             currentInputStream = null;
diff --git a/src/main/java/org/apache/commons/compress/archivers/examples/Expander.java b/src/main/java/org/apache/commons/compress/archivers/examples/Expander.java
index be2061776..3628a07c8 100644
--- a/src/main/java/org/apache/commons/compress/archivers/examples/Expander.java
+++ b/src/main/java/org/apache/commons/compress/archivers/examples/Expander.java
@@ -42,6 +42,7 @@ import org.apache.commons.compress.archivers.tar.TarFile;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 import org.apache.commons.compress.archivers.zip.ZipFile;
 import org.apache.commons.compress.utils.IOUtils;
+import org.apache.commons.io.output.NullOutputStream;
 
 /**
  * Provides a high level API for expanding archives.
@@ -85,7 +86,7 @@ public class Expander {
                     throw new IOException("Failed to create directory " + parent);
                 }
                 if (nullTarget) {
-                    writer.accept(nextEntry, null);
+                    writer.accept(nextEntry, NullOutputStream.INSTANCE);
                 } else {
                     try (OutputStream outputStream = Files.newOutputStream(targetPath)) {
                         writer.accept(nextEntry, outputStream);
diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
index 30d0bb006..6b56d430b 100644
--- a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
@@ -727,7 +727,7 @@ public class SevenZFile implements Closeable {
             // streams to get access to an entry. We defer this until really needed
             // so that entire blocks can be skipped without wasting time for decompression.
             try (InputStream stream = deferredBlockStreams.remove(0)) {
-                IOUtils.skip(stream, Long.MAX_VALUE);
+                org.apache.commons.io.IOUtils.skip(stream, Long.MAX_VALUE);
             }
             compressedBytesReadFromCurrentEntry = 0;
         }
diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java
index ef46e8f81..3818d297f 100644
--- a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java
@@ -52,8 +52,8 @@ import java.util.stream.StreamSupport;
 import java.util.zip.CRC32;
 
 import org.apache.commons.compress.archivers.ArchiveEntry;
-import org.apache.commons.compress.utils.CountingOutputStream;
 import org.apache.commons.compress.utils.TimeUtils;
+import org.apache.commons.io.output.CountingOutputStream;
 
 /**
  * Writes a 7z file.
@@ -217,14 +217,14 @@ public class SevenZOutputFile implements Closeable {
         if (fileBytesWritten > 0) { // this implies currentOutputStream != null
             entry.setHasStream(true);
             ++numNonEmptyStreams;
-            entry.setSize(currentOutputStream.getBytesWritten()); // NOSONAR
+            entry.setSize(currentOutputStream.getByteCount()); // NOSONAR
             entry.setCompressedSize(fileBytesWritten);
             entry.setCrcValue(crc32.getValue());
             entry.setCompressedCrcValue(compressedCrc32.getValue());
             entry.setHasCrc(true);
             if (additionalCountingStreams != null) {
                 final long[] sizes = new long[additionalCountingStreams.length];
-                Arrays.setAll(sizes, i -> additionalCountingStreams[i].getBytesWritten());
+                Arrays.setAll(sizes, i -> additionalCountingStreams[i].getByteCount());
                 additionalSizes.put(entry, sizes);
             }
         } else {
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
index 105cde470..d9bd6b683 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
@@ -322,7 +322,7 @@ public class TarArchiveInputStream extends ArchiveInputStream<TarArchiveEntry> {
     private void consumeRemainderOfLastBlock() throws IOException {
         final long bytesReadOfLastBlock = getBytesRead() % blockSize;
         if (bytesReadOfLastBlock > 0) {
-            final long skipped = IOUtils.skip(inputStream, blockSize - bytesReadOfLastBlock);
+            final long skipped = org.apache.commons.io.IOUtils.skip(inputStream, blockSize - bytesReadOfLastBlock);
             count(skipped);
         }
     }
@@ -417,7 +417,7 @@ public class TarArchiveInputStream extends ArchiveInputStream<TarArchiveEntry> {
 
         if (currEntry != null) {
             /* Skip will only go to the end of the current entry */
-            IOUtils.skip(this, Long.MAX_VALUE);
+            org.apache.commons.io.IOUtils.skip(this, Long.MAX_VALUE);
 
             /* skip to the end of the last record */
             skipRecordPadding();
@@ -796,7 +796,7 @@ public class TarArchiveInputStream extends ArchiveInputStream<TarArchiveEntry> {
         long skipped;
 
         if (!currEntry.isSparse()) {
-            skipped = IOUtils.skip(inputStream, numToSkip);
+            skipped = org.apache.commons.io.IOUtils.skip(inputStream, numToSkip);
             // for non-sparse entry, we should get the bytes actually skipped bytes along with
             // inputStream.available() if inputStream is instance of FileInputStream
             skipped = getActuallySkipped(availableOfInputStream, skipped, numToSkip);
@@ -819,7 +819,7 @@ public class TarArchiveInputStream extends ArchiveInputStream<TarArchiveEntry> {
             final long available = inputStream.available();
             final long numRecords = this.entrySize / this.recordSize + 1;
             final long padding = numRecords * this.recordSize - this.entrySize;
-            long skipped = IOUtils.skip(inputStream, padding);
+            long skipped = org.apache.commons.io.IOUtils.skip(inputStream, padding);
 
             skipped = getActuallySkipped(available, skipped, padding);
 
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
index b3a419b24..3e7330aa0 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
@@ -39,9 +39,9 @@ import org.apache.commons.compress.archivers.ArchiveOutputStream;
 import org.apache.commons.compress.archivers.zip.ZipEncoding;
 import org.apache.commons.compress.archivers.zip.ZipEncodingHelper;
 import org.apache.commons.compress.utils.CharsetNames;
-import org.apache.commons.compress.utils.CountingOutputStream;
 import org.apache.commons.compress.utils.FixedLengthBlockOutputStream;
 import org.apache.commons.compress.utils.TimeUtils;
+import org.apache.commons.io.output.CountingOutputStream;
 
 /**
  * The TarOutputStream writes a UNIX tar archive as an OutputStream. Methods are provided to put entries, and then write their contents by writing to this
@@ -431,7 +431,7 @@ public class TarArchiveOutputStream extends ArchiveOutputStream<TarArchiveEntry>
 
     @Override
     public long getBytesWritten() {
-        return countingOut.getBytesWritten();
+        return countingOut.getByteCount();
     }
 
     @Deprecated
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
index ef4538ee4..285ed65bb 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
@@ -611,7 +611,7 @@ public class TarUtils {
 
         // skip the rest of this record data
         final long bytesToSkip = recordSize - bytesRead % recordSize;
-        IOUtils.skip(inputStream, bytesToSkip);
+        org.apache.commons.io.IOUtils.skip(inputStream, bytesToSkip);
         return sparseHeaders;
     }
 
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 bcba5ea8f..9c8309db3 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
@@ -22,10 +22,10 @@ package org.apache.commons.compress.archivers.zip;
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.commons.compress.utils.CloseShieldFilterInputStream;
-import org.apache.commons.compress.utils.CountingInputStream;
 import org.apache.commons.compress.utils.ExactMath;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CloseShieldInputStream;
+import org.apache.commons.io.input.CountingInputStream;
 
 /**
  * The implode compression method was added to PKZIP 1.01 released in 1989. It was then dropped from PKZIP 2.0 released in 1993 in favor of the deflate method.
@@ -175,14 +175,14 @@ final class ExplodingInputStream extends InputStream implements InputStreamStati
     private void init() throws IOException {
         if (bits == null) {
             // we do not want to close in
-            try (CountingInputStream i = new CountingInputStream(new CloseShieldFilterInputStream(in))) {
+            try (CountingInputStream i = new CountingInputStream(CloseShieldInputStream.wrap(in))) {
                 if (numberOfTrees == 3) {
                     literalTree = BinaryTree.decode(i, 256);
                 }
 
                 lengthTree = BinaryTree.decode(i, 64);
                 distanceTree = BinaryTree.decode(i, 64);
-                treeSizes += i.getBytesRead();
+                treeSizes += i.getByteCount();
             }
 
             bits = new BitStream(in);
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
index 3db915ab5..0c6e62fb2 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
@@ -152,7 +152,8 @@ public class ZipArchiveInputStream extends ArchiveInputStream<ZipArchiveEntry> i
         @Override
         public long skip(final long n) throws IOException {
             final long toSkip = max >= 0 ? Math.min(n, max - pos) : n;
-            final long skippedBytes = IOUtils.skip(in, toSkip);
+            final InputStream input = in;
+            final long skippedBytes = org.apache.commons.io.IOUtils.skip(input, toSkip);
             pos += skippedBytes;
             return skippedBytes;
         }
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
index 090cc99a5..576a4e552 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
@@ -17,6 +17,7 @@
 package org.apache.commons.compress.archivers.zip;
 
 import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -40,7 +41,6 @@ import org.apache.commons.compress.archivers.ArchiveEntry;
 import org.apache.commons.compress.archivers.ArchiveOutputStream;
 import org.apache.commons.compress.utils.ByteUtils;
 import org.apache.commons.compress.utils.CharsetNames;
-import org.apache.commons.compress.utils.IOUtils;
 
 /**
  * Reimplementation of {@link java.util.zip.ZipOutputStream java.util.zip.ZipOutputStream} to handle the extended functionality of this package, especially
@@ -477,7 +477,8 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream<ZipArchiveEntry>
             // will never get opened properly when an exception is thrown so doesn't need to get closed
             streamCompressor = StreamCompressor.create(channel, def); // NOSONAR
         } catch (final IOException e) { // NOSONAR
-            IOUtils.closeQuietly(channel);
+            final Closeable c = channel;
+            org.apache.commons.io.IOUtils.closeQuietly(c);
             channel = null;
             outputStream = Files.newOutputStream(file, options);
             streamCompressor = StreamCompressor.create(outputStream, def);
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java
index 1cb047710..0b6215953 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java
@@ -24,7 +24,7 @@ import java.nio.charset.Charset;
 import java.nio.charset.UnsupportedCharsetException;
 
 import org.apache.commons.compress.utils.CharsetNames;
-import org.apache.commons.compress.utils.Charsets;
+import org.apache.commons.io.Charsets;
 
 /**
  * Static helper functions for robustly encoding file names in ZIP files.
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
index 9c20729aa..264bde75c 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
@@ -48,9 +48,9 @@ import org.apache.commons.compress.compressors.deflate64.Deflate64CompressorInpu
 import org.apache.commons.compress.utils.BoundedArchiveInputStream;
 import org.apache.commons.compress.utils.BoundedSeekableByteChannelInputStream;
 import org.apache.commons.compress.utils.CharsetNames;
-import org.apache.commons.compress.utils.CountingInputStream;
 import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CountingInputStream;
 
 /**
  * Replacement for {@link java.util.zip.ZipFile}.
@@ -138,7 +138,7 @@ public class ZipFile implements Closeable {
 
         @Override
         public long getCompressedCount() {
-            return super.getBytesRead();
+            return super.getByteCount();
         }
 
         @Override
@@ -359,7 +359,7 @@ public class ZipFile implements Closeable {
      * @param zipFile file to close, can be null
      */
     public static void closeQuietly(final ZipFile zipFile) {
-        IOUtils.closeQuietly(zipFile);
+        org.apache.commons.io.IOUtils.closeQuietly(zipFile);
     }
 
     /**
@@ -656,7 +656,7 @@ public class ZipFile implements Closeable {
         } finally {
             closed = !success;
             if (!success && closeOnError) {
-                IOUtils.closeQuietly(archive);
+                org.apache.commons.io.IOUtils.closeQuietly(archive);
             }
         }
     }
@@ -987,7 +987,7 @@ public class ZipFile implements Closeable {
     public String getUnixSymlink(final ZipArchiveEntry entry) throws IOException {
         if (entry != null && entry.isUnixSymlink()) {
             try (InputStream in = getInputStream(entry)) {
-                return zipEncoding.decode(IOUtils.toByteArray(in));
+                return zipEncoding.decode(org.apache.commons.io.IOUtils.toByteArray(in));
             }
         }
         return null;
diff --git a/src/main/java/org/apache/commons/compress/changes/ChangeSetPerformer.java b/src/main/java/org/apache/commons/compress/changes/ChangeSetPerformer.java
index faf5983b7..b7b739aca 100644
--- a/src/main/java/org/apache/commons/compress/changes/ChangeSetPerformer.java
+++ b/src/main/java/org/apache/commons/compress/changes/ChangeSetPerformer.java
@@ -31,7 +31,6 @@ import org.apache.commons.compress.archivers.ArchiveOutputStream;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 import org.apache.commons.compress.archivers.zip.ZipFile;
 import org.apache.commons.compress.changes.Change.ChangeType;
-import org.apache.commons.compress.utils.IOUtils;
 
 /**
  * Performs ChangeSet operations on a stream. This class is thread safe and can be used multiple times. It operates on a copy of the ChangeSet. If the ChangeSet
@@ -135,7 +134,7 @@ public class ChangeSetPerformer<I extends ArchiveInputStream<E>, O extends Archi
      */
     private void copyStream(final InputStream inputStream, final O outputStream, final E archiveEntry) throws IOException {
         outputStream.putArchiveEntry(archiveEntry);
-        IOUtils.copy(inputStream, outputStream);
+        org.apache.commons.io.IOUtils.copy(inputStream, outputStream);
         outputStream.closeArchiveEntry();
     }
 
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 f323c3917..9c910c4c0 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
@@ -21,9 +21,8 @@ import java.io.IOException;
 import java.io.InputStream;
 
 import org.apache.commons.compress.compressors.CompressorInputStream;
-import org.apache.commons.compress.utils.CountingInputStream;
-import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CountingInputStream;
 import org.brotli.dec.BrotliInputStream;
 
 /**
@@ -55,7 +54,7 @@ public class BrotliCompressorInputStream extends CompressorInputStream implement
      */
     @Override
     public long getCompressedCount() {
-        return countingInputStream.getBytesRead();
+        return countingInputStream.getByteCount();
     }
 
     @Override
@@ -94,7 +93,7 @@ public class BrotliCompressorInputStream extends CompressorInputStream implement
 
     @Override
     public long skip(final long n) throws IOException {
-        return IOUtils.skip(brotliInputStream, n);
+        return org.apache.commons.io.IOUtils.skip(brotliInputStream, n);
     }
 
     @Override
diff --git a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
index b37f86bce..a62313d99 100644
--- a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
@@ -31,8 +31,8 @@ import java.util.Arrays;
 
 import org.apache.commons.compress.compressors.CompressorInputStream;
 import org.apache.commons.compress.utils.BitInputStream;
-import org.apache.commons.compress.utils.CloseShieldFilterInputStream;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CloseShieldInputStream;
 
 /**
  * An input stream that decompresses from the BZip2 format to be read as any other stream.
@@ -276,7 +276,7 @@ public class BZip2CompressorInputStream extends CompressorInputStream implements
      * @throws IOException if {@code in == null}, the stream content is malformed, or an I/O error occurs.
      */
     public BZip2CompressorInputStream(final InputStream in, final boolean decompressConcatenated) throws IOException {
-        this.bin = new BitInputStream(in == System.in ? new CloseShieldFilterInputStream(in) : in, ByteOrder.BIG_ENDIAN);
+        this.bin = new BitInputStream(in == System.in ? CloseShieldInputStream.wrap(in) : in, ByteOrder.BIG_ENDIAN);
         this.decompressConcatenated = decompressConcatenated;
 
         init(true);
diff --git a/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStream.java
index 6f17db715..d9ff7de2a 100644
--- a/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStream.java
@@ -24,9 +24,8 @@ import java.util.zip.Inflater;
 import java.util.zip.InflaterInputStream;
 
 import org.apache.commons.compress.compressors.CompressorInputStream;
-import org.apache.commons.compress.utils.CountingInputStream;
-import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CountingInputStream;
 
 /**
  * Deflate decompressor.
@@ -102,7 +101,7 @@ public class DeflateCompressorInputStream extends CompressorInputStream implemen
      */
     @Override
     public long getCompressedCount() {
-        return countingStream.getBytesRead();
+        return countingStream.getByteCount();
     }
 
     /** {@inheritDoc} */
@@ -127,6 +126,6 @@ public class DeflateCompressorInputStream extends CompressorInputStream implemen
     /** {@inheritDoc} */
     @Override
     public long skip(final long n) throws IOException {
-        return IOUtils.skip(in, n);
+        return org.apache.commons.io.IOUtils.skip(in, n);
     }
 }
diff --git a/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStream.java
index 242bdb56d..dcac41ccd 100644
--- a/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStream.java
@@ -16,8 +16,7 @@
  */
 package org.apache.commons.compress.compressors.deflate64;
 
-import static org.apache.commons.compress.utils.IOUtils.closeQuietly;
-
+import java.io.Closeable;
 import java.io.IOException;
 import java.io.InputStream;
 
@@ -68,7 +67,8 @@ public class Deflate64CompressorInputStream extends CompressorInputStream implem
     }
 
     private void closeDecoder() {
-        closeQuietly(decoder);
+        final Closeable c = decoder;
+        org.apache.commons.io.IOUtils.closeQuietly(c);
         decoder = null;
     }
 
diff --git a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
index d1b547acf..dfa0bf641 100644
--- a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
@@ -32,9 +32,8 @@ import java.util.zip.Inflater;
 
 import org.apache.commons.compress.compressors.CompressorInputStream;
 import org.apache.commons.compress.utils.ByteUtils;
-import org.apache.commons.compress.utils.CountingInputStream;
-import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CountingInputStream;
 
 /**
  * Input stream that decompresses .gz files.
@@ -191,7 +190,7 @@ public class GzipCompressorInputStream extends CompressorInputStream implements
      */
     @Override
     public long getCompressedCount() {
-        return countingStream.getBytesRead();
+        return countingStream.getByteCount();
     }
 
     /**
@@ -339,7 +338,7 @@ public class GzipCompressorInputStream extends CompressorInputStream implements
                 in.reset();
 
                 final int skipAmount = bufUsed - inf.getRemaining();
-                if (IOUtils.skip(in, skipAmount) != skipAmount) {
+                if (org.apache.commons.io.IOUtils.skip(in, (long) skipAmount) != skipAmount) {
                     throw new IOException();
                 }
 
diff --git a/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStream.java
index 4a8020ea1..ee93fdfef 100644
--- a/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStream.java
@@ -26,9 +26,9 @@ import org.apache.commons.compress.compressors.CompressorInputStream;
 import org.apache.commons.compress.utils.BoundedInputStream;
 import org.apache.commons.compress.utils.ByteUtils;
 import org.apache.commons.compress.utils.ChecksumCalculatingInputStream;
-import org.apache.commons.compress.utils.CountingInputStream;
 import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CountingInputStream;
 
 /**
  * CompressorInputStream for the LZ4 frame format.
@@ -175,7 +175,7 @@ public class FramedLZ4CompressorInputStream extends CompressorInputStream implem
      */
     @Override
     public long getCompressedCount() {
-        return inputStream.getBytesRead();
+        return inputStream.getByteCount();
     }
 
     private void init(final boolean firstFrame) throws IOException {
@@ -368,7 +368,7 @@ public class FramedLZ4CompressorInputStream extends CompressorInputStream implem
             if (len < 0) {
                 throw new IOException("Found illegal skippable frame with negative size");
             }
-            final long skipped = IOUtils.skip(inputStream, len);
+            final long skipped = org.apache.commons.io.IOUtils.skip(inputStream, len);
             count(skipped);
             if (len != skipped) {
                 throw new IOException("Premature end of stream while skipping frame");
diff --git a/src/main/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStream.java
index d137663e6..1a083ece1 100644
--- a/src/main/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStream.java
@@ -24,9 +24,9 @@ import java.util.Arrays;
 
 import org.apache.commons.compress.compressors.CompressorInputStream;
 import org.apache.commons.compress.utils.ByteUtils;
-import org.apache.commons.compress.utils.CountingInputStream;
 import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CountingInputStream;
 
 /**
  * Encapsulates code common to LZ77 decompressors.
@@ -145,7 +145,7 @@ public abstract class AbstractLZ77CompressorInputStream extends CompressorInputS
      */
     @Override
     public long getCompressedCount() {
-        return in.getBytesRead();
+        return in.getByteCount();
     }
 
     /**
diff --git a/src/main/java/org/apache/commons/compress/compressors/lzma/LZMACompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/lzma/LZMACompressorInputStream.java
index bff56d913..5625db925 100644
--- a/src/main/java/org/apache/commons/compress/compressors/lzma/LZMACompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/lzma/LZMACompressorInputStream.java
@@ -23,9 +23,8 @@ import java.io.InputStream;
 
 import org.apache.commons.compress.MemoryLimitException;
 import org.apache.commons.compress.compressors.CompressorInputStream;
-import org.apache.commons.compress.utils.CountingInputStream;
-import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CountingInputStream;
 import org.tukaani.xz.LZMAInputStream;
 
 /**
@@ -102,7 +101,7 @@ public class LZMACompressorInputStream extends CompressorInputStream implements
      */
     @Override
     public long getCompressedCount() {
-        return countingStream.getBytesRead();
+        return countingStream.getByteCount();
     }
 
     /** {@inheritDoc} */
@@ -124,6 +123,6 @@ public class LZMACompressorInputStream extends CompressorInputStream implements
     /** {@inheritDoc} */
     @Override
     public long skip(final long n) throws IOException {
-        return IOUtils.skip(in, n);
+        return org.apache.commons.io.IOUtils.skip(in, n);
     }
 }
diff --git a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java
index 4e9d753f2..758029400 100644
--- a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java
@@ -28,8 +28,7 @@ import java.util.jar.JarOutputStream;
 
 import org.apache.commons.compress.compressors.CompressorInputStream;
 import org.apache.commons.compress.java.util.jar.Pack200;
-import org.apache.commons.compress.utils.CloseShieldFilterInputStream;
-import org.apache.commons.compress.utils.IOUtils;
+import org.apache.commons.io.input.CloseShieldInputStream;
 
 /**
  * An input stream that decompresses from the Pack200 format to be read as any other stream.
@@ -141,7 +140,7 @@ public class Pack200CompressorInputStream extends CompressorInputStream {
             if (file == null) {
                 // unpack would close this stream but we want to give the call site more control
                 // TODO unpack should not close its given stream.
-                try (CloseShieldFilterInputStream closeShield = new CloseShieldFilterInputStream(inputStream)) {
+                try (CloseShieldInputStream closeShield = CloseShieldInputStream.wrap(inputStream)) {
                     unpacker.unpack(closeShield, jarOut);
                 }
             } else {
@@ -264,6 +263,6 @@ public class Pack200CompressorInputStream extends CompressorInputStream {
     @SuppressWarnings("resource") // Does not allocate
     @Override
     public long skip(final long count) throws IOException {
-        return IOUtils.skip(getInputStream(), count);
+        return org.apache.commons.io.IOUtils.skip(getInputStream(), count);
     }
 }
diff --git a/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java
index d4fd47a89..5b85e347a 100644
--- a/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java
@@ -27,9 +27,9 @@ import org.apache.commons.codec.digest.PureJavaCrc32C;
 import org.apache.commons.compress.compressors.CompressorInputStream;
 import org.apache.commons.compress.utils.BoundedInputStream;
 import org.apache.commons.compress.utils.ByteUtils;
-import org.apache.commons.compress.utils.CountingInputStream;
 import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CountingInputStream;
 
 /**
  * CompressorInputStream for the framing Snappy format.
@@ -194,7 +194,7 @@ public class FramedSnappyCompressorInputStream extends CompressorInputStream imp
      */
     @Override
     public long getCompressedCount() {
-        return countingStream.getBytesRead() - unreadBytes;
+        return countingStream.getByteCount() - unreadBytes;
     }
 
     /** {@inheritDoc} */
@@ -334,7 +334,7 @@ public class FramedSnappyCompressorInputStream extends CompressorInputStream imp
         if (size < 0) {
             throw new IOException("Found illegal chunk with negative size");
         }
-        final long read = IOUtils.skip(inputStream, size);
+        final long read = org.apache.commons.io.IOUtils.skip(inputStream, (long) size);
         count(read);
         if (read != size) {
             throw new IOException("Premature end of stream");
diff --git a/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStream.java
index e126f9367..56d6767fc 100644
--- a/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStream.java
@@ -23,9 +23,8 @@ import java.io.InputStream;
 
 import org.apache.commons.compress.MemoryLimitException;
 import org.apache.commons.compress.compressors.CompressorInputStream;
-import org.apache.commons.compress.utils.CountingInputStream;
-import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CountingInputStream;
 import org.tukaani.xz.SingleXZInputStream;
 import org.tukaani.xz.XZ;
 import org.tukaani.xz.XZInputStream;
@@ -126,7 +125,7 @@ public class XZCompressorInputStream extends CompressorInputStream implements In
      */
     @Override
     public long getCompressedCount() {
-        return countingStream.getBytesRead();
+        return countingStream.getByteCount();
     }
 
     @Override
@@ -158,7 +157,7 @@ public class XZCompressorInputStream extends CompressorInputStream implements In
     @Override
     public long skip(final long n) throws IOException {
         try {
-            return IOUtils.skip(in, n);
+            return org.apache.commons.io.IOUtils.skip(in, n);
         } catch (final org.tukaani.xz.MemoryLimitException e) {
             // convert to commons-compress MemoryLimtException
             throw new MemoryLimitException(e.getMemoryNeeded(), e.getMemoryLimit(), e);
diff --git a/src/main/java/org/apache/commons/compress/compressors/zstandard/ZstdCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/zstandard/ZstdCompressorInputStream.java
index ff7af028d..105198d82 100644
--- a/src/main/java/org/apache/commons/compress/compressors/zstandard/ZstdCompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/zstandard/ZstdCompressorInputStream.java
@@ -21,9 +21,8 @@ import java.io.IOException;
 import java.io.InputStream;
 
 import org.apache.commons.compress.compressors.CompressorInputStream;
-import org.apache.commons.compress.utils.CountingInputStream;
-import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.compress.utils.InputStreamStatistics;
+import org.apache.commons.io.input.CountingInputStream;
 
 import com.github.luben.zstd.BufferPool;
 import com.github.luben.zstd.ZstdInputStream;
@@ -70,7 +69,7 @@ public class ZstdCompressorInputStream extends CompressorInputStream implements
      */
     @Override
     public long getCompressedCount() {
-        return countingStream.getBytesRead();
+        return countingStream.getByteCount();
     }
 
     @Override
@@ -112,7 +111,7 @@ public class ZstdCompressorInputStream extends CompressorInputStream implements
 
     @Override
     public long skip(final long n) throws IOException {
-        return IOUtils.skip(decIS, n);
+        return org.apache.commons.io.IOUtils.skip(decIS, n);
     }
 
     @Override
diff --git a/src/main/java/org/apache/commons/compress/utils/BitInputStream.java b/src/main/java/org/apache/commons/compress/utils/BitInputStream.java
index d13292162..18947e941 100644
--- a/src/main/java/org/apache/commons/compress/utils/BitInputStream.java
+++ b/src/main/java/org/apache/commons/compress/utils/BitInputStream.java
@@ -39,7 +39,7 @@ public class BitInputStream implements Closeable {
         }
     }
 
-    private final CountingInputStream in;
+    private final org.apache.commons.io.input.CountingInputStream in;
     private final ByteOrder byteOrder;
     private long bitsCached;
     private int bitsCachedSize;
@@ -51,7 +51,7 @@ public class BitInputStream implements Closeable {
      * @param byteOrder the bit arrangement across byte boundaries, either BIG_ENDIAN (aaaaabbb bb000000) or LITTLE_ENDIAN (bbbaaaaa 000000bb)
      */
     public BitInputStream(final InputStream in, final ByteOrder byteOrder) {
-        this.in = new CountingInputStream(in);
+        this.in = new org.apache.commons.io.input.CountingInputStream(in);
         this.byteOrder = byteOrder;
     }
 
@@ -128,7 +128,6 @@ public class BitInputStream implements Closeable {
 
     /**
      * Returns the number of bytes read from the underlying stream.
-     *
      * <p>
      * This includes the bytes read to fill the current cache and not read as bits so far.
      * </p>
@@ -137,7 +136,7 @@ public class BitInputStream implements Closeable {
      * @since 1.17
      */
     public long getBytesRead() {
-        return in.getBytesRead();
+        return in.getByteCount();
     }
 
     private long processBitsGreater57(final int count) throws IOException {
diff --git a/src/main/java/org/apache/commons/compress/utils/Charsets.java b/src/main/java/org/apache/commons/compress/utils/Charsets.java
index d2e35d35d..7dae9ca68 100644
--- a/src/main/java/org/apache/commons/compress/utils/Charsets.java
+++ b/src/main/java/org/apache/commons/compress/utils/Charsets.java
@@ -54,7 +54,9 @@ import java.nio.charset.StandardCharsets;
  * @see <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
  * @see StandardCharsets
  * @since 1.4
+ * @deprecated Use {@link org.apache.commons.io.Charsets}.
  */
+@Deprecated
 public class Charsets {
 
     //
diff --git a/src/main/java/org/apache/commons/compress/utils/CloseShieldFilterInputStream.java b/src/main/java/org/apache/commons/compress/utils/CloseShieldFilterInputStream.java
index f0cbe5ea3..7654c10e2 100644
--- a/src/main/java/org/apache/commons/compress/utils/CloseShieldFilterInputStream.java
+++ b/src/main/java/org/apache/commons/compress/utils/CloseShieldFilterInputStream.java
@@ -23,11 +23,15 @@ import java.io.FilterInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
+import org.apache.commons.io.input.CloseShieldInputStream;
+
 /**
  * Re-implements {@link FilterInputStream#close()} to do nothing.
  *
  * @since 1.14
+ * @deprecated Use {@link CloseShieldInputStream}.
  */
+@Deprecated
 public class CloseShieldFilterInputStream extends FilterInputStream {
 
     public CloseShieldFilterInputStream(final InputStream in) {
diff --git a/src/main/java/org/apache/commons/compress/utils/CountingInputStream.java b/src/main/java/org/apache/commons/compress/utils/CountingInputStream.java
index ad7e5eb99..5980dd41b 100644
--- a/src/main/java/org/apache/commons/compress/utils/CountingInputStream.java
+++ b/src/main/java/org/apache/commons/compress/utils/CountingInputStream.java
@@ -27,7 +27,9 @@ import java.io.InputStream;
  *
  * @since 1.3
  * @NotThreadSafe
+ * @deprecated Use {@link org.apache.commons.io.input.CountingInputStream}.
  */
+@Deprecated
 public class CountingInputStream extends FilterInputStream {
     private long bytesRead;
 
diff --git a/src/main/java/org/apache/commons/compress/utils/CountingOutputStream.java b/src/main/java/org/apache/commons/compress/utils/CountingOutputStream.java
index 1033511e8..8855008c6 100644
--- a/src/main/java/org/apache/commons/compress/utils/CountingOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/utils/CountingOutputStream.java
@@ -27,7 +27,9 @@ import java.io.OutputStream;
  *
  * @since 1.3
  * @NotThreadSafe
+ * @deprecated Use {@link org.apache.commons.io.output.CountingOutputStream}.
  */
+@Deprecated
 public class CountingOutputStream extends FilterOutputStream {
     private long bytesWritten;
 
diff --git a/src/main/java/org/apache/commons/compress/utils/IOUtils.java b/src/main/java/org/apache/commons/compress/utils/IOUtils.java
index f3b2319c6..d39c7adea 100644
--- a/src/main/java/org/apache/commons/compress/utils/IOUtils.java
+++ b/src/main/java/org/apache/commons/compress/utils/IOUtils.java
@@ -30,6 +30,8 @@ import java.nio.channels.ReadableByteChannel;
 import java.nio.file.Files;
 import java.nio.file.LinkOption;
 
+import org.apache.commons.io.FileUtils;
+
 /**
  * Utility functions
  *
@@ -38,7 +40,6 @@ import java.nio.file.LinkOption;
 public final class IOUtils {
 
     private static final int COPY_BUF_SIZE = 8024;
-    private static final int SKIP_BUF_SIZE = 4096;
 
     /**
      * Empty array of type {@link LinkOption}.
@@ -47,23 +48,16 @@ public final class IOUtils {
      */
     public static final LinkOption[] EMPTY_LINK_OPTIONS = {};
 
-    // This buffer does not need to be synchronized because it is write only; the contents are ignored
-    // Does not affect Immutability
-    private static final byte[] SKIP_BUF = new byte[SKIP_BUF_SIZE];
-
     /**
      * Closes the given Closeable and swallows any IOException that may occur.
      *
      * @param c Closeable to close, can be null
      * @since 1.7
+     * @deprecated Use {@link org.apache.commons.io.IOUtils#closeQuietly(Closeable)}.
      */
+    @Deprecated
     public static void closeQuietly(final Closeable c) {
-        if (c != null) {
-            try {
-                c.close();
-            } catch (final IOException ignored) { // NOPMD NOSONAR
-            }
-        }
+        org.apache.commons.io.IOUtils.closeQuietly(c);
     }
 
     /**
@@ -73,9 +67,11 @@ public final class IOUtils {
      * @param outputStream The output stream to write.
      * @throws IOException if an I/O error occurs when reading or writing.
      * @since 1.21
+     * @deprecated Use {@link FileUtils#copyFile(File, OutputStream)}.
      */
+    @Deprecated
     public static void copy(final File sourceFile, final OutputStream outputStream) throws IOException {
-        Files.copy(sourceFile.toPath(), outputStream);
+        FileUtils.copyFile(sourceFile, outputStream);
     }
 
     /**
@@ -85,9 +81,11 @@ public final class IOUtils {
      * @param output the target, may be null to simulate output to dev/null on Linux and NUL on Windows
      * @return the number of bytes copied
      * @throws IOException if an error occurs
+     * @deprecated Use {@link org.apache.commons.io.IOUtils#copy(InputStream, OutputStream)}.
      */
+    @Deprecated
     public static long copy(final InputStream input, final OutputStream output) throws IOException {
-        return copy(input, output, COPY_BUF_SIZE);
+        return org.apache.commons.io.IOUtils.copy(input, output);
     }
 
     /**
@@ -99,21 +97,11 @@ public final class IOUtils {
      * @return the number of bytes copied
      * @throws IOException              if an error occurs
      * @throws IllegalArgumentException if bufferSize is smaller than or equal to 0
+     * @deprecated Use {@link org.apache.commons.io.IOUtils#copy(InputStream, OutputStream, int)}.
      */
+    @Deprecated
     public static long copy(final InputStream input, final OutputStream output, final int bufferSize) throws IOException {
-        if (bufferSize < 1) {
-            throw new IllegalArgumentException("bufferSize must be bigger than 0");
-        }
-        final byte[] buffer = new byte[bufferSize];
-        int n = 0;
-        long count = 0;
-        while (-1 != (n = input.read(buffer))) {
-            if (output != null) {
-                output.write(buffer, 0, n);
-            }
-            count += n;
-        }
-        return count;
+        return org.apache.commons.io.IOUtils.copy(input, output, bufferSize);
     }
 
     /**
@@ -125,9 +113,11 @@ public final class IOUtils {
      * @return the number of bytes copied
      * @throws IOException if an error occurs
      * @since 1.21
+     * @deprecated Use {@link org.apache.commons.io.IOUtils#copyLarge(InputStream, OutputStream, long, long)}.
      */
+    @Deprecated
     public static long copyRange(final InputStream input, final long len, final OutputStream output) throws IOException {
-        return copyRange(input, len, output, COPY_BUF_SIZE);
+        return org.apache.commons.io.IOUtils.copyLarge(input, output, 0, len);
     }
 
     /**
@@ -217,15 +207,7 @@ public final class IOUtils {
         if (len < 0 || offset < 0 || len + offset > array.length || len + offset < 0) {
             throw new IndexOutOfBoundsException();
         }
-        int count = 0, x = 0;
-        while (count != len) {
-            x = input.read(array, offset + count, len - count);
-            if (x == -1) {
-                break;
-            }
-            count += x;
-        }
-        return count;
+        return org.apache.commons.io.IOUtils.read(input, array, offset, len);
     }
 
     /**
@@ -243,14 +225,7 @@ public final class IOUtils {
      */
     public static void readFully(final ReadableByteChannel channel, final ByteBuffer byteBuffer) throws IOException {
         final int expectedLength = byteBuffer.remaining();
-        int read = 0;
-        while (read < expectedLength) {
-            final int readNow = channel.read(byteBuffer);
-            if (readNow <= 0) {
-                break;
-            }
-            read += readNow;
-        }
+        final int read = org.apache.commons.io.IOUtils.read(channel, byteBuffer);
         if (read < expectedLength) {
             throw new EOFException();
         }
@@ -316,42 +291,29 @@ public final class IOUtils {
      * @param numToSkip the number of bytes to skip
      * @return the number of bytes actually skipped
      * @throws IOException on error
+     * @deprecated Use {@link org.apache.commons.io.IOUtils#skip(InputStream, long)}.
      */
+    @Deprecated
     public static long skip(final InputStream input, long numToSkip) throws IOException {
-        final long available = numToSkip;
-        while (numToSkip > 0) {
-            final long skipped = input.skip(numToSkip);
-            if (skipped == 0) {
-                break;
-            }
-            numToSkip -= skipped;
-        }
-
-        while (numToSkip > 0) {
-            final int read = readFully(input, SKIP_BUF, 0, (int) Math.min(numToSkip, SKIP_BUF_SIZE));
-            if (read < 1) {
-                break;
-            }
-            numToSkip -= read;
-        }
-        return available - numToSkip;
+        return org.apache.commons.io.IOUtils.skip(input, numToSkip);
     }
 
     /**
      * Gets the contents of an {@code InputStream} as a {@code byte[]}.
      * <p>
      * This method buffers the input internally, so there is no need to use a {@code BufferedInputStream}.
+     * </p>
      *
      * @param input the {@code InputStream} to read from
      * @return the requested byte array
      * @throws NullPointerException if the input is null
      * @throws IOException          if an I/O error occurs
      * @since 1.5
+     * @deprecated Use {@link org.apache.commons.io.IOUtils#toByteArray(InputStream)}.
      */
+    @Deprecated
     public static byte[] toByteArray(final InputStream input) throws IOException {
-        final ByteArrayOutputStream output = new ByteArrayOutputStream();
-        copy(input, output);
-        return output.toByteArray();
+        return org.apache.commons.io.IOUtils.toByteArray(input);
     }
 
     /** Private constructor to prevent instantiation of this utility class. */
diff --git a/src/test/java/org/apache/commons/compress/OsgiITest.java b/src/test/java/org/apache/commons/compress/OsgiITest.java
index 11b3e46bd..ff0706a02 100644
--- a/src/test/java/org/apache/commons/compress/OsgiITest.java
+++ b/src/test/java/org/apache/commons/compress/OsgiITest.java
@@ -53,6 +53,7 @@ public class OsgiITest {
                 mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.scr").version("2.0.14"),
                 mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.configadmin").version("1.8.16"),
                 mavenBundle().groupId("commons-codec").artifactId("commons-codec").version("1.16.0"),
+                mavenBundle().groupId("commons-io").artifactId("commons-io").version("2.15.1"),
                 composite(systemProperty("pax.exam.invoker").value("junit"), bundle("link:classpath:META-INF/links/org.ops4j.pax.tipi.junit.link"),
                         bundle("link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link"),
                         mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").version("1.3_1")),
diff --git a/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java b/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java
index a93236cf8..d61d4fa30 100644
--- a/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java
@@ -80,8 +80,8 @@ public class IOUtilsTest {
     }
 
     @Test
-    public void testCopyThrowsOnZeroBufferSize() {
-        assertThrows(IllegalArgumentException.class, () -> IOUtils.copy(new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY), new ByteArrayOutputStream(), 0));
+    public void testCopyThrowsOnZeroBufferSize() throws IOException {
+        assertEquals(0, IOUtils.copy(new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY), new ByteArrayOutputStream(), 0));
     }
 
     @Test


(commons-compress) 03/04: Javadoc spelling

Posted by gg...@apache.org.
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 de471d6e7601b905065ee5e6489678b70c40c4f7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 21 17:06:58 2023 -0500

    Javadoc spelling
---
 .../commons/compress/archivers/zip/X7875_NewUnix.java  |  4 ++--
 .../compress/archivers/zip/ZipEightByteInteger.java    |  2 +-
 .../apache/commons/compress/archivers/zip/ZipLong.java |  2 +-
 .../commons/compress/archivers/zip/ZipShort.java       |  2 +-
 .../org/apache/commons/compress/utils/ByteUtils.java   | 18 +++++++++---------
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/X7875_NewUnix.java b/src/main/java/org/apache/commons/compress/archivers/zip/X7875_NewUnix.java
index 3b50009d4..742fed087 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/X7875_NewUnix.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/X7875_NewUnix.java
@@ -42,9 +42,9 @@ import org.apache.commons.compress.utils.ByteUtils;
  * TSize         Short       total data size for this block
  * Version       1 byte      version of this extra field, currently 1
  * UIDSize       1 byte      Size of UID field
- * UID           Variable    UID for this entry (little endian)
+ * UID           Variable    UID for this entry (little-endian)
  * GIDSize       1 byte      Size of GID field
- * GID           Variable    GID for this entry (little endian)
+ * GID           Variable    GID for this entry (little-endian)
  *
  * Central-header version:
  *
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java
index 2abb62f74..8cd0ab6b3 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java
@@ -22,7 +22,7 @@ import java.io.Serializable;
 import java.math.BigInteger;
 
 /**
- * Utility class that represents an eight byte integer with conversion rules for the little endian byte order of ZIP files.
+ * Utility class that represents an eight byte integer with conversion rules for the little-endian byte order of ZIP files.
  *
  * @Immutable
  *
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
index 068dbb453..9412ef4aa 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
@@ -23,7 +23,7 @@ import java.io.Serializable;
 import org.apache.commons.compress.utils.ByteUtils;
 
 /**
- * Utility class that represents a four byte integer with conversion rules for the little endian byte order of ZIP files.
+ * Utility class that represents a four byte integer with conversion rules for the little-endian byte order of ZIP files.
  *
  * @Immutable
  */
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
index bd92de031..e103d65e0 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
@@ -21,7 +21,7 @@ import java.io.Serializable;
 import org.apache.commons.compress.utils.ByteUtils;
 
 /**
- * Utility class that represents a two byte integer with conversion rules for the little endian byte order of ZIP files.
+ * Utility class that represents a two byte integer with conversion rules for the little-endian byte order of ZIP files.
  *
  * @Immutable
  */
diff --git a/src/main/java/org/apache/commons/compress/utils/ByteUtils.java b/src/main/java/org/apache/commons/compress/utils/ByteUtils.java
index 0cde53df4..816f3a345 100644
--- a/src/main/java/org/apache/commons/compress/utils/ByteUtils.java
+++ b/src/main/java/org/apache/commons/compress/utils/ByteUtils.java
@@ -110,7 +110,7 @@ public final class ByteUtils {
     }
 
     /**
-     * Reads the given byte array as a little endian long.
+     * Reads the given byte array as a little-endian long.
      *
      * @param bytes the byte array to convert
      * @return the number read
@@ -120,7 +120,7 @@ public final class ByteUtils {
     }
 
     /**
-     * Reads the given byte array as a little endian long.
+     * Reads the given byte array as a little-endian long.
      *
      * @param bytes  the byte array to convert
      * @param off    the offset into the array that starts the value
@@ -138,7 +138,7 @@ public final class ByteUtils {
     }
 
     /**
-     * Reads the given number of bytes from the given supplier as a little endian long.
+     * Reads the given number of bytes from the given supplier as a little-endian long.
      *
      * <p>
      * Typically used by our InputStreams that need to count the bytes read as well.
@@ -164,7 +164,7 @@ public final class ByteUtils {
     }
 
     /**
-     * Reads the given number of bytes from the given input as little endian long.
+     * Reads the given number of bytes from the given input as little-endian long.
      *
      * @param in     the input to read from
      * @param length the number of bytes representing the value
@@ -184,7 +184,7 @@ public final class ByteUtils {
     }
 
     /**
-     * Reads the given number of bytes from the given stream as a little endian long.
+     * Reads the given number of bytes from the given stream as a little-endian long.
      *
      * @param in     the stream to read from
      * @param length the number of bytes representing the value
@@ -207,7 +207,7 @@ public final class ByteUtils {
     }
 
     /**
-     * Inserts the given value into the array as a little endian sequence of the given length starting at the given offset.
+     * Inserts the given value into the array as a little-endian sequence of the given length starting at the given offset.
      *
      * @param b      the array to write into
      * @param value  the value to insert
@@ -223,7 +223,7 @@ public final class ByteUtils {
     }
 
     /**
-     * Provides the given value to the given consumer as a little endian sequence of the given length.
+     * Provides the given value to the given consumer as a little-endian sequence of the given length.
      *
      * @param consumer the consumer to provide the bytes to
      * @param value    the value to provide
@@ -239,7 +239,7 @@ public final class ByteUtils {
     }
 
     /**
-     * Writes the given value to the given stream as a little endian array of the given length.
+     * Writes the given value to the given stream as a little-endian array of the given length.
      *
      * @param out    the output to write to
      * @param value  the value to write
@@ -256,7 +256,7 @@ public final class ByteUtils {
     }
 
     /**
-     * Writes the given value to the given stream as a little endian array of the given length.
+     * Writes the given value to the given stream as a little-endian array of the given length.
      *
      * @param out    the stream to write to
      * @param value  the value to write


(commons-compress) 02/04: Reuse Arrays.equals(byte[], byte[]) and deprecate ArchiveUtils.isEqual(byte[], byte[])

Posted by gg...@apache.org.
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 97078adb4b4a4727a694195d134071f84b834609
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 21 16:26:04 2023 -0500

    Reuse Arrays.equals(byte[], byte[]) and deprecate
    ArchiveUtils.isEqual(byte[], byte[])
---
 src/changes/changes.xml                                           | 1 +
 src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 5774f5178..ecdf2ce10 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -56,6 +56,7 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse commons-codec, don't duplicate class XXHash32 (deprecated class).</action>
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse commons-io, don't duplicate class Charsets (deprecated class).</action>
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse commons-io, don't duplicate class IOUtils (deprecated class).</action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse Arrays.equals(byte[], byte[]) and deprecate ArchiveUtils.isEqual(byte[], byte[]).</action>
       <action type="fix" dev="ggregory" due-to="alumi, Gary Gregory">Add a null-check for the class loader of OsgiUtils #451.</action>
       <action type="fix" dev="ggregory" due-to="alumi, Gary Gregory">Add a null-check in Pack200.newInstance(String, String).</action>
       <!--  UPDATE -->
diff --git a/src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java b/src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java
index 6a1d15013..ea866c6fc 100644
--- a/src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java
+++ b/src/main/java/org/apache/commons/compress/utils/ArchiveUtils.java
@@ -52,9 +52,11 @@ public class ArchiveUtils {
      * @param buffer1 the first buffer
      * @param buffer2 the second buffer
      * @return {@code true} if buffer1 and buffer2 have same contents
+     * @deprecated Use {@link Arrays#equals(byte[], byte[])}.
      */
+    @Deprecated
     public static boolean isEqual(final byte[] buffer1, final byte[] buffer2) {
-        return isEqual(buffer1, 0, buffer1.length, buffer2, 0, buffer2.length, false);
+        return Arrays.equals(buffer1, buffer2);
     }
 
     /**


(commons-compress) 04/04: Javadoc spelling

Posted by gg...@apache.org.
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 87a96f1c759f492dde8549051eb007a66b8b9653
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 21 17:08:40 2023 -0500

    Javadoc spelling
---
 .../apache/commons/compress/archivers/zip/AsiExtraField.java |  2 +-
 .../commons/compress/archivers/zip/ZipEightByteInteger.java  | 12 ++++++------
 .../org/apache/commons/compress/archivers/zip/ZipLong.java   | 10 +++++-----
 .../org/apache/commons/compress/archivers/zip/ZipShort.java  | 10 +++++-----
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java b/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java
index 0578e42a8..856c4c918 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java
@@ -49,7 +49,7 @@ import java.util.zip.ZipException;
  * </p>
  *
  * <p>
- * Short is two bytes and Long is four bytes in big endian byte and word order, device numbers are currently not supported.
+ * Short is two bytes and Long is four bytes in big-endian byte and word order, device numbers are currently not supported.
  * </p>
  *
  * @NotThreadSafe
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java
index 8cd0ab6b3..01190cdb4 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java
@@ -65,10 +65,10 @@ public final class ZipEightByteInteger implements Serializable {
     public static final ZipEightByteInteger ZERO = new ZipEightByteInteger(0);
 
     /**
-     * Gets value as eight bytes in big endian byte order.
+     * Gets value as eight bytes in big-endian byte order.
      *
      * @param value the value to convert
-     * @return value as eight bytes in big endian byte order
+     * @return value as eight bytes in big-endian byte order
      */
     public static byte[] getBytes(final BigInteger value) {
         final byte[] result = new byte[8];
@@ -88,10 +88,10 @@ public final class ZipEightByteInteger implements Serializable {
     }
 
     /**
-     * Gets value as eight bytes in big endian byte order.
+     * Gets value as eight bytes in big-endian byte order.
      *
      * @param value the value to convert
-     * @return value as eight bytes in big endian byte order
+     * @return value as eight bytes in big-endian byte order
      */
     public static byte[] getBytes(final long value) {
         return getBytes(BigInteger.valueOf(value));
@@ -202,9 +202,9 @@ public final class ZipEightByteInteger implements Serializable {
     }
 
     /**
-     * Gets value as eight bytes in big endian byte order.
+     * Gets value as eight bytes in big-endian byte order.
      *
-     * @return value as eight bytes in big endian order
+     * @return value as eight bytes in big-endian order
      */
     public byte[] getBytes() {
         return ZipEightByteInteger.getBytes(value);
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
index 9412ef4aa..7fbdbbea5 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
@@ -73,10 +73,10 @@ public final class ZipLong implements Cloneable, Serializable {
     public static final ZipLong AED_SIG = new ZipLong(0X08064B50L);
 
     /**
-     * Gets value as four bytes in big endian byte order.
+     * Gets value as four bytes in big-endian byte order.
      *
      * @param value the value to convert
-     * @return value as four bytes in big endian byte order
+     * @return value as four bytes in big-endian byte order
      */
     public static byte[] getBytes(final long value) {
         final byte[] result = new byte[WORD];
@@ -106,7 +106,7 @@ public final class ZipLong implements Cloneable, Serializable {
     }
 
     /**
-     * put the value as four bytes in big endian byte order.
+     * put the value as four bytes in big-endian byte order.
      *
      * @param value  the Java long to convert to bytes
      * @param buf    the output buffer
@@ -182,9 +182,9 @@ public final class ZipLong implements Cloneable, Serializable {
     }
 
     /**
-     * Gets value as four bytes in big endian byte order.
+     * Gets value as four bytes in big-endian byte order.
      *
-     * @return value as four bytes in big endian order
+     * @return value as four bytes in big-endian order
      */
     public byte[] getBytes() {
         return ZipLong.getBytes(value);
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
index e103d65e0..e8bb23d95 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
@@ -36,10 +36,10 @@ public final class ZipShort implements Cloneable, Serializable {
     private static final long serialVersionUID = 1L;
 
     /**
-     * Gets value as two bytes in big endian byte order.
+     * Gets value as two bytes in big-endian byte order.
      *
      * @param value the Java int to convert to bytes
-     * @return the converted int as a byte array in big endian byte order
+     * @return the converted int as a byte array in big-endian byte order
      */
     public static byte[] getBytes(final int value) {
         final byte[] result = new byte[2];
@@ -69,7 +69,7 @@ public final class ZipShort implements Cloneable, Serializable {
     }
 
     /**
-     * put the value as two bytes in big endian byte order.
+     * put the value as two bytes in big-endian byte order.
      *
      * @param value  the Java int to convert to bytes
      * @param buf    the output buffer
@@ -134,9 +134,9 @@ public final class ZipShort implements Cloneable, Serializable {
     }
 
     /**
-     * Gets value as two bytes in big endian byte order.
+     * Gets value as two bytes in big-endian byte order.
      *
-     * @return the value as a two byte array in big endian byte order
+     * @return the value as a two byte array in big-endian byte order
      */
     public byte[] getBytes() {
         final byte[] result = new byte[2];