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 a720ad7e6 Javadoc a720ad7e6 is described below commit a720ad7e6c7d72c6510430115587a4796eea0a5d Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun Apr 20 08:23:34 2025 -0400 Javadoc Reduce vertical space --- .../commons/compress/compressors/zstandard/ZstdUtils.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/compressors/zstandard/ZstdUtils.java b/src/main/java/org/apache/commons/compress/compressors/zstandard/ZstdUtils.java index 3106fc189..4d2b7d891 100644 --- a/src/main/java/org/apache/commons/compress/compressors/zstandard/ZstdUtils.java +++ b/src/main/java/org/apache/commons/compress/compressors/zstandard/ZstdUtils.java @@ -23,7 +23,14 @@ /** * Utility code for the Zstandard compression format. * + * <p> + * This class avoids making the underlying {@code zstd} classes part of the public or protected API. The underlying implementation is provided through the + * <a href="https://github.com/luben/zstd-jni/">Zstandard JNI</a> library which is based on <a href="https://github.com/facebook/zstd/">zstd</a>. + * </p> + * * @ThreadSafe + * @see <a href="https://github.com/luben/zstd-jni/">Zstandard JNI</a> + * @see <a href="https://github.com/facebook/zstd/">zstd</a> * @since 1.16 */ public class ZstdUtils { @@ -87,7 +94,6 @@ public static boolean matches(final byte[] signature, final int length) { if (length < ZSTANDARD_FRAME_MAGIC.length) { return false; } - boolean isZstandard = true; for (int i = 0; i < ZSTANDARD_FRAME_MAGIC.length; ++i) { if (signature[i] != ZSTANDARD_FRAME_MAGIC[i]) { @@ -98,7 +104,6 @@ public static boolean matches(final byte[] signature, final int length) { if (isZstandard) { return true; } - if (0x50 == (signature[0] & 0xF0)) { // skippable frame for (int i = 0; i < SKIPPABLE_FRAME_MAGIC.length; ++i) { @@ -106,10 +111,8 @@ public static boolean matches(final byte[] signature, final int length) { return false; } } - return true; } - return false; }