How to Convert ZIP to TAR.Z Using C#
In order to convert ZIP to TAR.Z, we’ll use
API which is a feature-rich, powerful and easy to use archive conversion API for C# platform. Open
package manager, search for Aspose.ZIP and install. You may also use the following command from the Package Manager Console.
Package Manager Console Command
PM> Install-Package Aspose.Zip
Steps to Convert ZIP to TAR.Z via C#
Convertation from one archive format to another consist of following steps:
- Extract archive to intermediate storage
- Compress extracted data to desired format
System Requirements
Before running the conversion example code, make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with .NET Framework, Mono and COM Interop.
- Development environment like Microsoft Visual Studio.
- Aspose.ZIP for .NET DLL referenced in your project.
Convert from ZIP archives to TAR.Z - C#
using (TarArchive tarArchive = new TarArchive())
{
using (Archive archive = new Archive("source.zip"))
{
for (int i = 0; i < archive.Entries.Count; i++)
{
var ms = new MemoryStream();
archive.Entries[i].Extract(ms);
ms.Seek(0, SeekOrigin.Begin);
tarArchive.CreateEntry(archive.Entries[i].Name.Replace('\\', '/'), ms);
}
}
tarArchive.SaveZCompressed("output.tar.z");
}
Free App to Convert ZIP to TAR.Z
Check our live demos for ZIP to TAR.Z conversion with following benefits.
No need to download or setup anything.
No need to write any code.
Just upload your ZIP archive and hit the "Convert" button.
You will instantly get the download link for TAR.Z file.
A reliable Aspose.ZIP Library that can compress, extract, encrypt, decrypt, convert and merge archives. Aspose.ZIP for .NET API allows to manipulate various archive types without without going into the underlying complexity of the compress file formats with minimum coding efforts.
Other Supported Conversions
You can also convert ZIP into many other file formats including few listed below.
ZIP to ZIP (Zipped (compressed) Files)
ZIP TO 7ZIP (7zip Archive)
ZIP TO TAR.BZ2 (Burrows–Wheeler Compressor)
ZIP TO CPIO (Copy In, Copy Out Archive)
ZIP TO TAR.GZ (Streaming Deflate Compressor)
ZIP TO TAR.LZ (LZMA Multi-Block Compressed Data)
ZIP TO TAR (Tape Archive)
ZIP TO TAR.XZ (Container for Compressed Streams)
ZIP TO TAR.Z (LZW Compressor)