Package org.apache.commons.compress
Class MemoryLimitException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.apache.commons.compress.MemoryLimitException
- All Implemented Interfaces:
Serializable
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final long
A long instead of int to account for overflow for corrupt files.private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionMemoryLimitException
(long memoryNeededInKb, int memoryLimitInKb) MemoryLimitException
(long memoryNeededInKb, int memoryLimitInKb, Exception e) -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
buildMessage
(long memoryNeededInKb, int memoryLimitInKb) int
long
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
memoryNeededInKb
private final long memoryNeededInKbA long instead of int to account for overflow for corrupt files. -
memoryLimitInKb
private final int memoryLimitInKb
-
-
Constructor Details
-
MemoryLimitException
public MemoryLimitException(long memoryNeededInKb, int memoryLimitInKb) -
MemoryLimitException
-
-
Method Details
-
buildMessage
-
getMemoryLimitInKb
public int getMemoryLimitInKb() -
getMemoryNeededInKb
public long getMemoryNeededInKb()
-