Class ZstdException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ZstdException
    extends java.lang.RuntimeException
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long code  
    • Constructor Summary

      Constructors 
      Constructor Description
      ZstdException​(long result)
      Construct a ZstdException from the result of a Zstd library call.
      ZstdException​(long code, java.lang.String message)
      Construct a ZstdException with a manually-specified error code and message.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getErrorCode()
      Get the Zstd error code that caused the exception.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

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

      • code

        private long code
    • Constructor Detail

      • ZstdException

        public ZstdException​(long result)
        Construct a ZstdException from the result of a Zstd library call. The error code and message are automatically looked up using Zstd.getErrorCode and Zstd.getErrorName.
        Parameters:
        result - the return value of a Zstd library call
      • ZstdException

        public ZstdException​(long code,
                             java.lang.String message)
        Construct a ZstdException with a manually-specified error code and message. No transformation of either the code or message is done. It is advised that one of the Zstd.err*() is used to obtain a stable error code.
        Parameters:
        code - a Zstd error code
        message - the exception's message
    • Method Detail

      • getErrorCode

        public long getErrorCode()
        Get the Zstd error code that caused the exception. This will likely correspond to one of the Zstd.err*() methods, but the Zstd library may return error codes that are not yet stable. In such cases, this method will return the code reported by Zstd, but it will not correspond to any of the Zstd.err*() methods.
        Returns:
        a Zstd error code