Class ZstdUtils


  • public class ZstdUtils
    extends java.lang.Object
    Utility code for the Zstandard compression format.
    Since:
    1.16
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static byte[] SKIPPABLE_FRAME_MAGIC
      Skippable Frame Magic Bytes - the three common bytes.
      private static byte[] ZSTANDARD_FRAME_MAGIC
      Zstandard Frame Magic Bytes.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ZstdUtils()
      Private constructor to prevent instantiation of this utility class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isZstdCompressionAvailable()
      Are the classes required to support Zstandard compression available?
      static boolean matches​(byte[] signature, int length)
      Checks if the signature matches what is expected for a Zstandard file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ZSTANDARD_FRAME_MAGIC

        private static final byte[] ZSTANDARD_FRAME_MAGIC
        Zstandard Frame Magic Bytes.
      • SKIPPABLE_FRAME_MAGIC

        private static final byte[] SKIPPABLE_FRAME_MAGIC
        Skippable Frame Magic Bytes - the three common bytes.
    • Constructor Detail

      • ZstdUtils

        private ZstdUtils()
        Private constructor to prevent instantiation of this utility class.
    • Method Detail

      • isZstdCompressionAvailable

        public static boolean isZstdCompressionAvailable()
        Are the classes required to support Zstandard compression available?
        Returns:
        true if the classes required to support Zstandard compression are available
      • matches

        public static boolean matches​(byte[] signature,
                                      int length)
        Checks if the signature matches what is expected for a Zstandard file.
        Parameters:
        signature - the bytes to check
        length - the number of bytes to check
        Returns:
        true if signature matches the Ztstandard or skippable frame magic bytes, false otherwise