CpioArchive.SaveLzipped
Contents
[
Hide
]SaveLzipped(Stream, CpioFormat)
Saves archive to the stream with lzip compression.
public void SaveLzipped(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)
| Parameter | Type | Description | 
|---|---|---|
| output | Stream | Destination stream. | 
| cpioFormat | CpioFormat | Defines cpio header format. | 
Exceptions
| exception | condition | 
|---|---|
| ArgumentNullException | output is null. | 
| ArgumentException | output is not writable. | 
| ObjectDisposedException | Archive has been disposed and cannot be used. | 
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
- enum CpioFormat
 - class CpioArchive
 - namespace Aspose.Zip.Cpio
 - assembly Aspose.Zip
 
SaveLzipped(string, CpioFormat)
Saves archive to the file by path with lzip compression.
public void SaveLzipped(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)
| Parameter | Type | Description | 
|---|---|---|
| path | String | The path of the archive to be created. If the specified file name points to an existing file, it will be overwritten. | 
| cpioFormat | CpioFormat | Defines cpio header format. | 
Exceptions
| exception | condition | 
|---|---|
| ObjectDisposedException | Archive has been disposed and cannot be used. | 
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
- enum CpioFormat
 - class CpioArchive
 - namespace Aspose.Zip.Cpio
 - assembly Aspose.Zip