CpioArchive.SaveGzipped
Contenu
[
Cacher
]SaveGzipped(Stream, CpioFormat)
Enregistre l’archive dans le flux avec compression gzip.
public void SaveGzipped(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)
Paramètre | Taper | La description |
---|---|---|
output | Stream | Flux de destination. |
cpioFormat | CpioFormat | Définit le format d’en-tête cpio. |
Exceptions
exception | condition |
---|---|
ArgumentNullException | output est nul. |
ArgumentException | output n’est pas inscriptible. |
Remarques
outputdoit être inscriptible.
Exemples
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);
}
}
}
Voir également
- enum CpioFormat
- class CpioArchive
- espace de noms Aspose.Zip.Cpio
- Assemblée Aspose.Zip
SaveGzipped(string, CpioFormat)
Enregistre l’archive dans le fichier par chemin avec compression gzip.
public void SaveGzipped(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)
Paramètre | Taper | La description |
---|---|---|
path | String | Le chemin de l’archive à créer. Si le nom de fichier spécifié pointe vers un fichier existant, il sera écrasé. |
cpioFormat | CpioFormat | Définit le format d’en-tête cpio. |
Exemples
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");
}
}
Voir également
- enum CpioFormat
- class CpioArchive
- espace de noms Aspose.Zip.Cpio
- Assemblée Aspose.Zip