SaveXzCompressed

CpioArchive.SaveXzCompressed method (1 of 2)

Saves archive to the stream with xz compression.

public void SaveXzCompressed(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii, 
    XzArchiveSettings settings = null)
ParameterTypeDescription
outputStreamDestination stream.
cpioFormatCpioFormatDefines cpio header format.
settingsXzArchiveSettingsSet of setting particular xz archive: dictionary size, block size, check type.

Exceptions

exceptioncondition
ArgumentNullExceptionoutput is null.
ArgumentExceptionoutput is not writable.

Remarks

outputThe stream must be writable.

Examples

using (FileStream result = File.OpenWrite("result.cpio.xz"))
{
    using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
    {
        using (var archive = new CpioArchive())
        {
            archive.CreateEntry("entry.bin", source);
            archive.SaveXzCompressed(result);
        }
    }
}

See Also


CpioArchive.SaveXzCompressed method (2 of 2)

Saves archive to the path by path with xz compression.

public void SaveXzCompressed(string path, CpioFormat cpioFormat = CpioFormat.OldAscii, 
    XzArchiveSettings settings = null)
ParameterTypeDescription
pathStringThe path of the archive to be created. If the specified file name points to an existing file, it will be overwritten.
cpioFormatCpioFormatDefines cpio header format.
settingsXzArchiveSettingsSet of setting particular xz archive: dictionary size, block size, check type.

Examples

using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
    using (var archive = new CpioArchive())
    {
        archive.CreateEntry("entry.bin", source);
        archive.SaveXzCompressed("result.cpio.xz");
    }
}

See Also