DecodeLimits
Overview
DecodeLimits is a class in Aspose.PDF FOSS for Java.
Central guard against decompression bombs in stream decode filters (FlateDecode, LZWDecode, RunLengthDecode).
This class provides 2 methods for working with DecodeLimits objects in Java programs.
Available methods include: check, maxDecodedBytes.
All public members are accessible to any Java application after installing the Aspose.PDF FOSS for Java package.
Properties: DEFAULT_MAX_DECODED_BYTES, PROPERTY.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
PROPERTY | String | Read | System property that overrides the decoded-stream size cap (bytes). |
DEFAULT_MAX_DECODED_BYTES | long | Read | Default cap on a single decoded stream: 256 MB. |
Methods
| Signature | Description |
|---|---|
maxDecodedBytes() → long | Returns the current cap on a single decoded stream in bytes, |
| or {@link Long#MAX_VALUE} when the guard is disabled. | |
check(decodedSoFar: long, limit: long, filterName: String) | Throws when {@code decodedSoFar} exceeds the cap. |