ParallelCompressionMode
Contents
[
Hide
]Inheritance: java.lang.Object, java.lang.Enum
public enum ParallelCompressionMode extends Enum<ParallelCompressionMode>
Options of usage parallel compression facility.
Fields
Field | Description |
---|---|
Always | Do compress in parallel. |
Auto | Decide if use parallel compression or not upon the entries. |
Never | Do not compress in parallel. |
Methods
Method | Description |
---|---|
valueOf(String name) | |
values() |
Always
public static final ParallelCompressionMode Always
Do compress in parallel. Beware out of memory.
try (Archive archive = new Archive()) {
archive.createEntry("filename.bin", "filename.bin");
archive.createEntry("filename1.bin", "filename1.bin");
archive.createEntry("filename2.bin", "filename2.bin");
ParallelOptions parallelOptions = new ParallelOptions();
parallelOptions.setParallelCompressInMemory(ParallelCompressionMode.Always);
ArchiveSaveOptions archiveSaveOptions = new ArchiveSaveOptions();
archiveSaveOptions.setParallelOptions(parallelOptions);
archive.save(destination, archiveSaveOptions);
}
Auto
public static final ParallelCompressionMode Auto
Decide if use parallel compression or not upon the entries. This option may compress in parallel some entries only.
try (Archive archive = new Archive()) {
archive.createEntry("filename.bin", "filename.bin");
archive.createEntry("filename1.bin", "filename1.bin");
archive.createEntry("filename2.bin", "filename2.bin");
ParallelOptions parallelOptions = new ParallelOptions();
parallelOptions.setParallelCompressInMemory(ParallelCompressionMode.Auto);
ArchiveSaveOptions archiveSaveOptions = new ArchiveSaveOptions();
archiveSaveOptions.setParallelOptions(parallelOptions);
archive.save(destination, archiveSaveOptions);
}
Never
public static final ParallelCompressionMode Never
Do not compress in parallel.
try (Archive archive = new Archive()) {
archive.createEntry("filename.bin", "filename.bin");
archive.createEntry("filename1.bin", "filename1.bin");
archive.createEntry("filename2.bin", "filename2.bin");
ParallelOptions parallelOptions = new ParallelOptions();
parallelOptions.setParallelCompressInMemory(ParallelCompressionMode.Never);
ArchiveSaveOptions archiveSaveOptions = new ArchiveSaveOptions();
archiveSaveOptions.setParallelOptions(parallelOptions);
archive.save(destination, archiveSaveOptions);
}
valueOf(String name)
public static ParallelCompressionMode valueOf(String name)
Parameters:
Parameter | Type | Description |
---|---|---|
name | java.lang.String |
Returns: ParallelCompressionMode
values()
public static ParallelCompressionMode[] values()
Returns: com.aspose.zip.ParallelCompressionMode[]