Class CpioArchive

Class CpioArchive

اسم الفضاء : Aspose.Zip.Cpio تجميع: Aspose.Zip.dll (25.5.0)

هذه الفئة تمثل ملف أرشيف cpio.

public class CpioArchive : IArchive, IDisposable

Inheritance

object CpioArchive

Implements

IArchive , IDisposable

الأعضاء الموروثين

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

CpioArchive()

يبدأ حالة جديدة من فئة Aspose.Zip.Cpio.CpioArchive.

public CpioArchive()

Examples

يظهر المثال التالي كيفية ضغط ملف.

using (var archive = new CpioArchive())
{
    archive.CreateEntry("first.bin", "data.bin");
    archive.Save("archive.cpio");
}

CpioArchive(Stream)

يبدأ مثالًا جديدًا من فئة Aspose.Zip.Cpio.CpioArchive ويجمع قائمة إدخال يمكن استخراجها من الأرشيف.

public CpioArchive(Stream sourceStream)

Parameters

sourceStream Stream

مصدر الأرشيف يجب أن يكون قابلًا للبحث.

Examples

يظهر المثال التالي كيفية استخراج جميع الإدخالات إلى دليل.

using (var archive = new CpioArchive(File.OpenRead("archive.cpio")))
{ 
   archive.ExtractToDirectory("C:\extracted");
}

Remarks

هذا المصنع لا يقطع أي إدخال. انظر Aspose.Zip.Cpio.CpioEntry.Open طريقة لقطع.

Exceptions

ArgumentNullException

sourceStream’ is null.

ArgumentException

sourceStream’ is not seekable.

InvalidDataException

sourceStream’ is not valid cpio archive.

CpioArchive(الستار)

يبدأ مثالًا جديدًا من فئة Aspose.Zip.Cpio.CpioArchive ويجمع قائمة إدخال يمكن استخراجها من الأرشيف.

public CpioArchive(string path)

Parameters

path string

الطريق إلى ملف الأرشيف.

Examples

يظهر المثال التالي كيفية استخراج جميع الإدخالات إلى دليل.

using (var archive = new CpioArchive("archive.cpio")) 
{ 
   archive.ExtractToDirectory("C:\extracted");
}

Remarks

هذا المصنع لا يقطع أي إدخال. انظر Aspose.Zip.Cpio.CpioEntry.Open طريقة لقطع.

Exceptions

ArgumentNullException

path’ is null.

SecurityException

لا يحصل المتصل على إذن الوصول المطلوب.

ArgumentException

الطريق " فارغ ، يحتوي على مساحات بيضاء فقط ، أو يحتوي على أحرف غير صحيحة.

UnauthorizedAccessException

يتم رفض الوصول إلى ملف path".

PathTooLongException

على سبيل المثال ، على المنصات المستندة إلى Windows ، يجب أن تكون المسارات أقل من 248 حرفًا ، ويجب أن يكون اسم الملف أقل من 260 حرفًا.

NotSupportedException

ملف في path’ يحتوي على عمود (:) في وسط السلسلة.

FileNotFoundException

لم يتم العثور على الملف.

DirectoryNotFoundException

المسار المحدد غير صالح ، على سبيل المثال ، على محرك أقراص غير مسجلة.

IOException

الملف مفتوح بالفعل.

Properties

Entries

يحصل على إدخالات من Aspose.Zip.Cpio.CpioEntry النوع الذي يشكل الأرشيف.

public ReadOnlyCollection<cpioentry> Entries { get; }

قيمة الممتلكات

ReadOnlyCollection &lt؛ CpioEntry >

Methods

CreateEntries(البول، البول)

إضافة إلى الأرشيف جميع الملفات والمجلدات مرارا وتكرارا في الدليل المحدد.

public CpioArchive CreateEntries(string sourceDirectory, bool includeRootDirectory = true)

Parameters

sourceDirectory string

فيديوهات متعلقة بـ Compress

includeRootDirectory bool

إشارة إلى ما إذا كان لإدراج الدليل الجذر نفسه أم لا.

Returns

CpioArchive

إدخال Cpio instance.

Examples

using (FileStream cpioFile = File.Open("archive.cpio", FileMode.Create))
{
    using (var archive = new CpioArchive())
    {
        archive.CreateEntries("C:\folder", false);
        archive.Save(cpioFile);
    }
}

Exceptions

ArgumentNullException

sourceDirectory’ is null.

SecurityException

لا يتمتع المكالمة بالترخيص المطلوب للوصول إلى sourceDirectory'.

ArgumentException

sourceDirectory’ contains invalid characters such as “, <, >, or |.

PathTooLongException

المسار المحدد، اسم الملف، أو كلاهما يتجاوز الحد الأقصى المحدد النظام. على سبيل المثال، على منصات ويندوز، يجب أن تكون المسارات أقل من 248 حرف، وأسماء الملفات يجب أن تكون أقل من 260 حرف.

IOException

sourceDirectory’ stands for a file, not for a directory.

CreateEntries(أرشيف الوسم : Bool)

إضافة إلى الأرشيف جميع الملفات والمجلدات مرارا وتكرارا في الدليل المحدد.

public CpioArchive CreateEntries(DirectoryInfo directory, bool includeRootDirectory = true)

Parameters

directory DirectoryInfo

فيديوهات متعلقة بـ Compress

includeRootDirectory bool

إشارة إلى ما إذا كان لإدراج الدليل الجذر نفسه أم لا.

Returns

CpioArchive

إدخال Cpio instance.

Examples

using (FileStream cpioFile = File.Open("archive.cpio", FileMode.Create))
{
    using (var archive = new CpioArchive())
    {
        archive.CreateEntries(new DirectoryInfo("C:\folder"), false);
        archive.Save(cpioFile);
    }
}

Exceptions

ArgumentNullException

directory’ is null.

SecurityException

لا يحصل المتصل على السماح المطلوب للوصول إلى directory”.

IOException

directory’ stands for a file, not for a directory.

CreateEntry(أرشيف الوسم : FileInfo, Bool)

إنشاء إدخال واحد داخل الأرشيف.

public CpioEntry CreateEntry(string name, FileInfo fileInfo, bool openImmediately = false)

Parameters

name string

اسم الدخول .

fileInfo FileInfo

سيتم ضغط البيانات الميتا من الملف أو المجلد.

openImmediately bool

صحيح، إذا قمت بفتح الملف على الفور، وإلا فتح الملف على حفظ الأرشيف.

Returns

CpioEntry

إدخال Cpio instance.

Examples

FileInfo fileInfo = new FileInfo("data.bin");
using (var archive = new CpioArchive())
{
    archive.CreateEntry("test.bin", fileInfo);
    archive.Save("archive.cpio");
}

Remarks

إذا تم فتح الملف على الفور مع المعيار فإنه يتم حظرها حتى يتم إزالة الأرشيف.

Exceptions

ArgumentNullException

name’ is null.

ArgumentException

name’ is empty.

ArgumentNullException

fileInfo’ is null.

CreateEntry(قوس قزح، قوس قزح)

إنشاء إدخال واحد داخل الأرشيف.

public CpioEntry CreateEntry(string name, string sourcePath, bool openImmediately = false)

Parameters

name string

اسم الدخول .

sourcePath string

الطريق إلى التسجيل لتكون مضغوطة.

openImmediately bool

صحيح، إذا قمت بفتح الملف على الفور، وإلا فتح الملف على حفظ الأرشيف.

Returns

CpioEntry

إدخال Cpio instance.

Examples

using (var archive = new CpioArchive())
{
    archive.CreateEntry("first.bin", "data.bin");
    archive.Save("archive.cpio");
}

Remarks

يتم تعيين اسم الإدخال فقط داخل المعلم.لا يؤثر اسم الملف المقدمة في المعلم على اسم الإدخال.

إذا تم فتح الملف على الفور مع المعيار فإنه يتم حظرها حتى يتم إزالة الأرشيف.

Exceptions

ArgumentNullException

sourcePath’ is null.

SecurityException

لا يحصل المتصل على إذن الوصول المطلوب.

ArgumentException

فالمصدر sourcePath’ فارغ، يحتوي فقط على مساحات بيضاء، أو يحتوي على أحرف غير صحيحة. - أو - اسم الملف، كجزء من name"، يتجاوز 100 رمز.

UnauthorizedAccessException

يتم رفض الوصول إلى ملف sourcePath'.

PathTooLongException

على سبيل المثال ، على المنصات المستندة إلى Windows ، يجب أن تكون المسارات أقل من 248 حرفًا ، ويجب أن تكون أسماء الملفات أقل من 260 حرفًا. - أو - name’ طويل جدًا لـ cpio.

NotSupportedException

ملف في sourcePath’ يحتوي على عمود (:) في وسط السلسلة.

CreateEntry(الشريط , Stream)

إنشاء إدخال واحد داخل الأرشيف.

public CpioEntry CreateEntry(string name, Stream source)

Parameters

name string

اسم الدخول .

source Stream

تدفق الدخول للمدخل.

Returns

CpioEntry

إدخال Cpio instance.

Examples

using (var archive = new CpioArchive())
{
    archive.CreateEntry("data.bin", File.OpenRead("data.bin"));
    archive.Save("archive.cpio");
}

Exceptions

ArgumentNullException

name’ is null.

ArgumentNullException

source’ is null.

ArgumentException

name’ is empty.

DeleteEntry(CpioEntry)

إزالة الحدث الأول من إدخال معين من قائمة الإدخال.

public CpioArchive DeleteEntry(CpioEntry entry)

Parameters

entry CpioEntry

إدخال إزالة من قائمة الإدخالات.

Returns

CpioArchive

إدخال Cpio instance.

Examples

إليك كيفية إزالة جميع الإدخالات باستثناء الأخير:

using (var archive = new CpioArchive("archive.cpio"))
{
    while (archive.Entries.Count &gt; 1)
        archive.DeleteEntry(archive.Entries[0]);
    archive.Save(outputCpioFile);
}

Exceptions

ArgumentNullException

entry’ is null.

DeleteEntry(إنت)

إزالة الإدخال من قائمة الإدخال بواسطة المؤشر.

public CpioArchive DeleteEntry(int entryIndex)

Parameters

entryIndex int

المؤشر القائم على الصفر من الدخول لإزالة.

Returns

CpioArchive

تم حذف الأرشيف مع الإدخال.

Examples

using (var archive = new CpioArchive("two_files.cpio"))
{
    archive.DeleteEntry(0);
    archive.Save("single_file.cpio");
}

Exceptions

ArgumentOutOfRangeException

entryIndex’ is less than 0.-or- entryIndex’ is equal to or greater than ‘Entries’ count.

Dispose()

يمارس المهام المحددة في التطبيق المرتبطة بتفريغ أو إطلاق أو إعادة تدوير الموارد غير المعالجة.

public void Dispose()

Dispose(بول)

يمارس المهام المحددة في التطبيق المرتبطة بتفريغ أو إطلاق أو إعادة تدوير الموارد غير المعالجة.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

هل ينبغي تخصيص الموارد التي يتم إدارةها؟

ExtractToDirectory(الستار)

استخراج جميع الملفات في الأرشيف إلى الدليل المقدمة.

public void ExtractToDirectory(string destinationDirectory)

Parameters

destinationDirectory string

الطريق إلى الدليل لوضع الملفات المستخرجة في.

Examples

using (var archive = new CpioArchive("archive.cpio")) 
{ 
   archive.ExtractToDirectory("C:\extracted");
}

Remarks

إذا لم يكن الدليل موجودًا ، فسيتم إنشاؤه.

Exceptions

ArgumentNullException

الطريق صفر

PathTooLongException

على سبيل المثال، على منصات ويندوز، يجب أن تكون المسارات أقل من 248 حرف، وأسماء الملفات يجب أن تكون أقل من 260 حرف.

SecurityException

لا يتمتع المكالمة بالترخيص المطلوب للوصول إلى الدليل الحالي.

NotSupportedException

إذا لم يكن الدليل موجودًا ، فإن المسار يحتوي على حرف العمود الفقري (:) الذي ليس جزءًا من علامة محرك الأقراص (“C:”).

ArgumentException

المسار هو سلسلة صفر الطول، يحتوي فقط على مساحة بيضاء، أو يحتوي على شخصية واحدة أو أكثر غير مؤهلة.يمكنك الاستعلام عن شخصيات غير مؤهلة باستخدام طريقة System.IO.Path.GetInvalidPathChars. -أو- المسار محدد مسبقا مع، أو يحتوي، فقط حرف العمود الفقري (:).

IOException

المجلد المحدد بالطريق هو ملف. -أو- اسم الشبكة غير معروف.

Save(الكمبيوتر، CpioFormat)

حفظ الأرشيف إلى ملف الوجهة المقدمة.

public void Save(string destinationFileName, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

destinationFileName string

إذا كان اسم الملف المحدد يشير إلى ملف موجود ، فسيتم إعادة كتابته.

cpioFormat CpioFormat

تحديد شكل cpio header.

Examples

using (var archive = new CpioArchive())
{
    archive.CreateEntry("entry1", "data.bin");        
    archive.Save("archive.cpio");
}

Remarks

من الممكن حفظ الأرشيف في نفس المسار الذي تم تحميله من. ومع ذلك، هذا لا ينصح لأن هذا النهج يستخدم نسخ إلى ملف مؤقت.

Exceptions

ArgumentException

destinationFileName’ is a zero-length string, contains only white space, or contains one or more invalid characters as defined by System.IO.Path.InvalidPathChars.

ArgumentNullException

destinationFileName’ is null.

PathTooLongException

المحدد destinationFileName، اسم الملف، أو كلاهما يتجاوز الحد الأقصى الذي يحدده النظام.على سبيل المثال، على منصات ويندوز، يجب أن تكون المسارات أقل من 248 حرفا، وأسماء الملفات يجب أن تكون أقل من 260 حرفا.

DirectoryNotFoundException

المحدد destinationFileName’ غير صالح، (على سبيل المثال، هو على محرك أقراص غير مسجلة).

IOException

حدث خطأ I/O أثناء فتح الملف.

UnauthorizedAccessException

destinationFileName’Specified a file is read-only and access is not Read.-or- path specified a directory.-or- The caller does not have the required permission.

NotSupportedException

destinationFileName’ is in an invalid format.

Save(الشبكة، CpioFormat)

حفظ الأرشيف إلى التدفق المقدم.

public void Save(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

output Stream

النطاق المستهدف

cpioFormat CpioFormat

تحديد شكل cpio header.

Examples

using (FileStream cpioFile = File.Open("archive.cpio", FileMode.Create))
{
    using (var archive = new CpioArchive())
    {
        archive.CreateEntry("entry1", "data.bin");        
        archive.Save(cpioFile);
    }
}

Remarks

يجب أن تكون مكتوبة.

Exceptions

ArgumentNullException

output’ is null.

ArgumentException

output’ is not writable. - or - output’ is the same stream we extract from.- OR -It is impossible to save archive in cpioFormat’ due to format restrictions.

SaveGzipped(الشبكة، CpioFormat)

توفير الأرشيف إلى التدفق باستخدام ضغط gzip.

public void SaveGzipped(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

output Stream

النطاق المستهدف

cpioFormat CpioFormat

تحديد شكل cpio header.

Examples

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

Remarks

يجب أن تكون مكتوبة.

Exceptions

ArgumentNullException

output’ is null.

ArgumentException

output’ is not writable.

SaveGzipped(الكمبيوتر، CpioFormat)

حفظ الأرشيف إلى الملف عن طريق الطريق مع ضغط gzip.

public void SaveGzipped(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

path string

إذا كان اسم الملف المحدد يشير إلى ملف موجود ، فسيتم إعادة كتابته.

cpioFormat CpioFormat

تحديد شكل cpio header.

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

التخزين المضغوط(الشبكة، CpioFormat)

حفظ الأرشيف إلى التدفق باستخدام ضغط LZMA.

public void SaveLZMACompressed(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

output Stream

النطاق المستهدف

cpioFormat CpioFormat

تحديد شكل cpio header.

Examples

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

Remarks

يجب أن تكون مكتوبة.

مهم: يتم تجميع أرشيف cpio ثم يتم ضغطها داخل هذه الطريقة ، يتم الاحتفاظ بمحتواه داخليًا.

التخزين المضغوط(الكمبيوتر، CpioFormat)

تخزين الأرشيف إلى الملف عن طريق الطريق مع ضغط lzma.

public void SaveLZMACompressed(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

path string

إذا كان اسم الملف المحدد يشير إلى ملف موجود ، فسيتم إعادة كتابته.

cpioFormat CpioFormat

تحديد شكل cpio header.

Examples

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

Remarks

مهم: يتم تجميع أرشيف cpio ثم يتم ضغطها داخل هذه الطريقة ، يتم الاحتفاظ بمحتواه داخليًا.

SaveLzipped(الشبكة، CpioFormat)

تخزين الأرشيف إلى التدفق باستخدام ضغط lzip.

public void SaveLzipped(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

output Stream

النطاق المستهدف

cpioFormat CpioFormat

تحديد شكل cpio header.

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

Remarks

يجب أن تكون مكتوبة.

Exceptions

ArgumentNullException

output’ is null.

ArgumentException

output’ is not writable.

SaveLzipped(الكمبيوتر، CpioFormat)

حفظ الأرشيف إلى الملف عن طريق الطريق مع ضغط lzip.

public void SaveLzipped(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

path string

إذا كان اسم الملف المحدد يشير إلى ملف موجود ، فسيتم إعادة كتابته.

cpioFormat CpioFormat

تحديد شكل cpio header.

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

SaveXzCompressed(Stream، CpioFormat، XzArchiveSettings)

توفير الأرشيف إلى التدفق مع ضغط xz.

public void SaveXzCompressed(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii, XzArchiveSettings settings = null)

Parameters

output Stream

النطاق المستهدف

cpioFormat CpioFormat

تحديد شكل cpio header.

settings XzArchiveSettings

مجموعة إعدادات محددة xz أرشيف: حجم القاموس، حجم الكتلة، نوع التحقق.

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

Remarks

يجب أن يكون التدفق مكتوبًا.

Exceptions

ArgumentNullException

output’ is null.

ArgumentException

output’ is not writable.

SaveXzCompressed(إعدادات, CpioFormat, XzArchiveSettings)

تخزين الأرشيف إلى الطريق عن طريق الطريق مع ضغط xz.

public void SaveXzCompressed(string path, CpioFormat cpioFormat = CpioFormat.OldAscii, XzArchiveSettings settings = null)

Parameters

path string

إذا كان اسم الملف المحدد يشير إلى ملف موجود ، فسيتم إعادة كتابته.

cpioFormat CpioFormat

تحديد شكل cpio header.

settings XzArchiveSettings

مجموعة إعدادات محددة xz أرشيف: حجم القاموس، حجم الكتلة، نوع التحقق.

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

أضف تعليق(الشبكة، CpioFormat)

توفير الأرشيف إلى التدفق مع ضغط Z.

public void SaveZCompressed(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

output Stream

النطاق المستهدف

cpioFormat CpioFormat

تحديد شكل cpio header.

Examples

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

Remarks

يجب أن تكون مكتوبة.

Exceptions

ArgumentNullException

output’ is null.

ArgumentException

output’ is not writable.

أضف تعليق(الكمبيوتر، CpioFormat)

تخزين الأرشيف إلى المسار عن طريق الطريق مع ضغط Z.

public void SaveZCompressed(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

path string

إذا كان اسم الملف المحدد يشير إلى ملف موجود ، فسيتم إعادة كتابته.

cpioFormat CpioFormat

تحديد شكل cpio header.

Examples

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

SaveZstandard(الشبكة، CpioFormat)

حفظ الأرشيف إلى التدفق باستخدام ضغط Zstandard.

public void SaveZstandard(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

output Stream

النطاق المستهدف

cpioFormat CpioFormat

تحديد شكل cpio header.

Examples

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

Remarks

يجب أن تكون مكتوبة.

Exceptions

ArgumentNullException

output’ is null.

ArgumentException

output’ is not writable.

SaveZstandard(الكمبيوتر، CpioFormat)

تخزين الأرشيف إلى الملف عن طريق الطريق مع ضغط Zstandard.

public void SaveZstandard(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)

Parameters

path string

إذا كان اسم الملف المحدد يشير إلى ملف موجود ، فسيتم إعادة كتابته.

cpioFormat CpioFormat

تحديد شكل cpio header.

Examples

using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
    using (var archive = new CpioArchive())
    {
        archive.CreateEntry("entry.bin", source);
        archive.SaveZstandard("result.cpio.zst");
    }
}
 عربي