Package eu.europa.esig.dss.pdf
Class PdfMemoryUsageSetting
java.lang.Object
eu.europa.esig.dss.pdf.PdfMemoryUsageSetting
Represents the PDF document loading setting on signature creation or validation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumMemoryUsageSetting's load options -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructorprotectedPdfMemoryUsageSetting(PdfMemoryUsageSetting.Mode mode, long maxMemoryBytes, long maxStorageBytes) Constructor with memory allocation parameters -
Method Summary
Modifier and TypeMethodDescriptionstatic PdfMemoryUsageSettingfileOnly()It represents file only unrestricted allocation size load mode.static PdfMemoryUsageSettingfileOnly(long maxStorageBytes) It represents file only unrestricted allocation size load mode.longGets the maximum number of bytes to be allocated in memory.longGets the maximum number of bytes to be allocated in both memory and temporary file.getMode()Gets the PDF memory usage modestatic PdfMemoryUsageSettingIt represents memory unrestricted allocation size load mode.static PdfMemoryUsageSettingmemoryBuffered(long maxBytes) It represents memory unrestricted allocation size load mode.static PdfMemoryUsageSettingIt represents a memory-forced type of handling.static PdfMemoryUsageSettingmixed(long maxMemoryBytes) It represents mixed memory-first unrestricted file allocation size load mode.static PdfMemoryUsageSettingmixed(long maxMemoryBytes, long maxStorageBytes) It represents mixed memory-first restricted file allocation size load mode.toString()
-
Constructor Details
-
PdfMemoryUsageSetting
Default constructor- Parameters:
mode-PdfMemoryUsageSetting.Modethe memory handling mode
-
PdfMemoryUsageSetting
protected PdfMemoryUsageSetting(PdfMemoryUsageSetting.Mode mode, long maxMemoryBytes, long maxStorageBytes) Constructor with memory allocation parameters- Parameters:
mode-PdfMemoryUsageSetting.Modethe memory handling modemaxMemoryBytes- the maximum number of bytes to be allocated in memorymaxStorageBytes- the maximum number of bytes to be allocated both in memory and in a temporary file
-
-
Method Details
-
getMode
Gets the PDF memory usage mode- Returns:
- MemoryUsageSetting's load option
PdfMemoryUsageSetting.Mode
-
getMaxMemoryBytes
public long getMaxMemoryBytes()Gets the maximum number of bytes to be allocated in memory. NOTE: applicable only when mode isMode.MEMORYorMode.MIXED(implementation dependent)- Returns:
- max bytes to be loaded into memory
-
getMaxStorageBytes
public long getMaxStorageBytes()Gets the maximum number of bytes to be allocated in both memory and temporary file. NOTE: applicable only when mode isMode.FILEorMode.MIXED(implementation dependent)- Returns:
- max bytes to be loaded into file
-
memoryFull
It represents a memory-forced type of handling. When chosen, the File is read and loaded to a byte array before processing.- Returns:
- the PDF document load setting
PdfMemoryUsageSetting
-
memoryBuffered
It represents memory unrestricted allocation size load mode. When this method is chosen, the file is loaded to the memory, as needed.- Returns:
- the PDF document load setting
PdfMemoryUsageSetting
-
memoryBuffered
It represents memory unrestricted allocation size load mode. When this method is chosen, the file is loaded to the memory, as needed.- Parameters:
maxBytes- max allocation size- Returns:
- the PDF document load setting
PdfMemoryUsageSetting
-
fileOnly
It represents file only unrestricted allocation size load mode. When this method is chosen, the content of a file is stored in a temporary file in filesystem.- Returns:
- the PDF document load setting
PdfMemoryUsageSetting
-
fileOnly
It represents file only unrestricted allocation size load mode. When this method is chosen, the content of a file is stored in a temporary file in filesystem.- Parameters:
maxStorageBytes- max allocation size- Returns:
- the PDF document load setting
PdfMemoryUsageSetting
-
mixed
It represents mixed memory-first unrestricted file allocation size load mode. When this mode is chosen, the content of file is stored in memory before exceeding ofmaxMemoryBytes, and the rest is stored in a temporary file in a filesystem.- Parameters:
maxMemoryBytes- max memory allocation size- Returns:
- the PDF document load setting
PdfMemoryUsageSetting
-
mixed
It represents mixed memory-first restricted file allocation size load mode. When this mode is chosen, the content of file is stored in memory before exceeding ofmaxMemoryBytes, and the rest is stored in a temporary file in a filesystem.- Parameters:
maxMemoryBytes- max memory allocation sizemaxStorageBytes- max size the memory and temporary file may have together- Returns:
- the PDF document load setting
PdfMemoryUsageSetting
-
toString
-