Converting ZIP to 7z

Contents
[ Hide Show ]

If you want to convert the ZIP archive to 7z read this article.

Aspose.Zip now allows composing 7z archive with LZMA, LZMA2, PPMd and BZip2 compression algorithms.

Convertation

Aspose.ZIP API provides the  SevenZipArchive class to work with 7z archives.  We can extract an entry to memory without saving it into intermediate storage and pass it into the 7z archive right away.

Make sure you have enough virtual memory to keep the content of all entries.

Transfer an Entry

The following code example demonstrates how to extract entries from the ZIP archive and immediately put them to the 7z archive. 7z entries will be compressed with the LZMA2 method regardless of what algorithm they had in the source archive. Entries that are directories are skipped, but their files are added respecting relative paths.

                
            
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.