Class MemoryLimitException

  • All Implemented Interfaces:
    java.io.Serializable

    public class MemoryLimitException
    extends CompressException
    If a stream checks for estimated memory allocation, and the estimate goes above the memory limit, this is thrown. This can also be thrown if a stream tries to allocate a byte array that is larger than the allowable limit.
    Since:
    1.14
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getMemoryLimitInKb()
      Gets the memory limit in kibibytes (KiB).
      long getMemoryNeededInKb()
      Gets the memory needed in kibibytes (KiB).
      • 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
    • Constructor Detail

      • MemoryLimitException

        public MemoryLimitException​(long memoryNeededKiB,
                                    int memoryLimitKiB)
        Constructs a new instance.
        Parameters:
        memoryNeededKiB - The memory needed in kibibytes (KiB).
        memoryLimitKiB - The memory limit in kibibytes (KiB).
      • MemoryLimitException

        @Deprecated
        public MemoryLimitException​(long memoryNeededKiB,
                                    int memoryLimitKiB,
                                    java.lang.Exception cause)
        Constructs a new instance.
        Parameters:
        memoryNeededKiB - The memory needed in kibibytes (KiB).
        memoryLimitKiB - The memory limit in kibibytes (KiB).
        cause - The cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
      • MemoryLimitException

        public MemoryLimitException​(long memoryNeededKiB,
                                    int memoryLimitKiB,
                                    java.lang.Throwable cause)
        Constructs a new instance.
        Parameters:
        memoryNeededKiB - The memory needed in kibibytes (KiB).
        memoryLimitKiB - The memory limit in kibibytes (KiB).
        cause - The cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
    • Method Detail

      • getMemoryLimitInKb

        public int getMemoryLimitInKb()
        Gets the memory limit in kibibytes (KiB).
        Returns:
        the memory limit in kibibytes (KiB).
      • getMemoryNeededInKb

        public long getMemoryNeededInKb()
        Gets the memory needed in kibibytes (KiB).
        Returns:
        the memory needed in kibibytes (KiB).