CpioArchive.SaveXzCompressed

SaveXzCompressed(Stream, CpioFormat, XzArchiveSettings)

Slaat archief op in de stream met xz-compressie.

public void SaveXzCompressed(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii, 
    XzArchiveSettings settings = null)
ParameterTypeBeschrijving
outputStreamBestemmingsstroom.
cpioFormatCpioFormatDefinieert de indeling van de cpio-header.
settingsXzArchiveSettingsSet instellingen specifiek xz-archief: woordenboekgrootte, blokgrootte, controletype.

Uitzonderingen

uitzonderingvoorwaarde
ArgumentNullExceptionoutput is niets.
ArgumentExceptionoutput is niet beschrijfbaar.

Opmerkingen

outputDe stream moet beschrijfbaar zijn.

Voorbeelden

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);
        }
    }
}

Zie ook


SaveXzCompressed(string, CpioFormat, XzArchiveSettings)

Slaat archief pad voor pad op met xz-compressie.

public void SaveXzCompressed(string path, CpioFormat cpioFormat = CpioFormat.OldAscii, 
    XzArchiveSettings settings = null)
ParameterTypeBeschrijving
pathStringHet pad van het aan te maken archief. Als de opgegeven bestandsnaam naar een bestaand bestand verwijst, wordt dit overschreven.
cpioFormatCpioFormatDefinieert de indeling van de cpio-header.
settingsXzArchiveSettingsSet instellingen specifiek xz-archief: woordenboekgrootte, blokgrootte, controletype.

Voorbeelden

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");
    }
}

Zie ook