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

NameTypeAccessDescription
PROPERTYStringReadSystem property that overrides the decoded-stream size cap (bytes).
DEFAULT_MAX_DECODED_BYTESlongReadDefault cap on a single decoded stream: 256 MB.

Methods

SignatureDescription
maxDecodedBytes()longReturns 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.

See Also