CpioArchive.SaveXzCompressed

SaveXzCompressed(Stream, CpioFormat, XzArchiveSettings)

xz 圧縮でアーカイブをストリームに保存します。

public void SaveXzCompressed(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii, 
    XzArchiveSettings settings = null)
パラメータタイプ説明
outputStream宛先ストリーム。
cpioFormatCpioFormatcpio ヘッダー形式を定義します。
settingsXzArchiveSettings特定の xz アーカイブの設定のセット: 辞書サイズ、ブロック サイズ、チェック タイプ。

例外

例外調子
ArgumentNullExceptionoutput無効である。
ArgumentExceptionoutput書き込み不可です。

備考

outputストリームは書き込み可能である必要があります。

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

関連項目


SaveXzCompressed(string, CpioFormat, XzArchiveSettings)

xz 圧縮でパスごとにアーカイブをパスに保存します。

public void SaveXzCompressed(string path, CpioFormat cpioFormat = CpioFormat.OldAscii, 
    XzArchiveSettings settings = null)
パラメータタイプ説明
pathString作成するアーカイブのパス。指定したファイル名が既存のファイルを指している場合、上書きされます。
cpioFormatCpioFormatcpio ヘッダー形式を定義します。
settingsXzArchiveSettings特定の 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.cpio.xz");
    }
}

関連項目