XAR composition

Contents
[ Hide Show ]

Overview

Xar is popular Mac OS archiving format. You can compose such an archive with Aspose.Zip similarly as other archives.

Aspose.Zip can compose XAR archives with entries stored and compressed with Zzib and bzip2.

Create archive

Following sample composes XAR archive with two entries compressed with Zlib method

1java.io.File fi1 = new java.io.File("alice29.txt");
2java.io.File fi2 = new java.io.File("asyoulik.txt");
3String xarFile = "output.xar";
4
5try (XarArchive archive = new XarArchive(new XarZlibCompressionSettings())) {
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.