CpioArchive.SaveXzCompressed

SaveXzCompressed(Stream, CpioFormat, XzArchiveSettings)

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


SaveXzCompressed(string, CpioFormat, XzArchiveSettings)

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