Class ZstdUtils


  • public class ZstdUtils
    extends java.lang.Object
    Utility code for the Zstandard compression format.
    Since:
    1.16
    • 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.
      static void setCacheZstdAvailablity​(boolean doCache)
      Whether to cache the result of the Zstandard for Java check.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
      • setCacheZstdAvailablity

        public static void setCacheZstdAvailablity​(boolean doCache)
        Whether to cache the result of the Zstandard for Java check.

        This defaults to false in an OSGi environment and true otherwise.

        Parameters:
        doCache - whether to cache the result
      • 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