SaveLzipped

CpioArchive.SaveLzipped method (1 of 2)

Saves archive to the stream with lzip compression.

public void SaveLzipped(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)
ParameterTypeDescription
outputStreamDestination stream.
cpioFormatCpioFormatDefines cpio header format.

Exceptions

exceptioncondition
ArgumentNullExceptionoutput is null.
ArgumentExceptionoutput is not writable.

Remarks

output must be writable.

Examples

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

See Also


CpioArchive.SaveLzipped method (2 of 2)

Saves archive to the file by path with lzip compression.

public void SaveLzipped(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)
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.

Examples

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

See Also