Parallel LZMA2 in 7z Archives

Overview

Aspose.ZIP API lets compose 7-Zip archives. One of its compression methods is LZMA2, which can be compressed in several threads.

LZMA2 mutlithreaded compression

This sample composes 7z archive with the single entry, that will be compressed using 4 threads.

1SevenZipLZMA2CompressionSettings compressionSettings = new SevenZipLZMA2CompressionSettings();
2compressionSettings.setCompressionThreads(4);
3SevenZipEntrySettings settings = new SevenZipEntrySettings(compressionSettings);
4try (SevenZipArchive archive = new SevenZipArchive(settings)) {
5    archive.createEntry("first.bin", "data.bin");
6    archive.save("result.7z");
7}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.