Class Brotli4jLoader

java.lang.Object
com.aayushatharva.brotli4j.Brotli4jLoader

public class Brotli4jLoader extends Object
Loads Brotli Native Library
  • Field Details

    • UNAVAILABILITY_CAUSE

      private static final Throwable UNAVAILABILITY_CAUSE
  • Constructor Details

    • Brotli4jLoader

      public Brotli4jLoader()
  • Method Details

    • isAvailable

      public static boolean isAvailable()
      Returns:
      true if the Brotli native library is available else false.
    • ensureAvailability

      public static void ensureAvailability()
      Ensure Brotli native library is available.
      Throws:
      UnsatisfiedLinkError - If unavailable.
    • getUnavailabilityCause

      public static Throwable getUnavailabilityCause()
    • resolveWorkdir

      static File resolveWorkdir() throws IOException
      Resolves the directory used to extract the bundled native library.

      If the com.aayushatharva.brotli4j.native.workdir system property is set, it is used as the extraction directory (created if it does not exist). Otherwise falls back to java.io.tmpdir. A custom workdir is useful when java.io.tmpdir is mounted noexec.

      Throws:
      IOException
    • getPlatform

      private static String getPlatform()