XAR composition

Contents
[ Hide Show ]

Overview

XAR is a popular archiving format for macOS. You can create XAR archives using Aspose.Zip in a manner similar to other archive formats.

Aspose.Zip allows you to compose XAR archives with entries that are either uncompressed or compressed using Zlib or Bzip2 methods.

Create archive

The following sample demonstrates how to compose a XAR archive with two entries compressed using the Zlib method:

1    FileInfo fi1 = new FileInfo("alice29.txt");
2    FileInfo fi2 = new FileInfo("asyoulik.txt");
3
4    using (var archive = new XarArchive(new XarZlibCompressionSettings()))
5    {
6        archive.CreateEntry("alice29.txt", fi1, false);
7        archive.CreateEntry("fields.c", fi2, false);
8        archive.Save(xarFile);
9    }
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.