ZstandardArchive.Open
Contents
[
Hide
]ZstandardArchive.Open method
Opens the archive for extraction and provides a stream with archive content.
public Stream Open()
Return Value
The stream that represents the contents of the archive.
Remarks
Read from the stream to get original content of file. See examples section.
Examples
Extracts the archive and copies extracted content to file stream.
using (var archive = new ZstandardArchive("archive.zst"))
{
using (var extracted = File.Create("data.bin"))
{
var unpacked = archive.Open();
byte[] b = new byte[8192];
int bytesRead;
while (0 < (bytesRead = unpacked.Read(b, 0, b.Length)))
extracted.Write(b, 0, bytesRead);
}
}
You may use Stream.CopyTo method for .NET 4.0 and higher:
unpacked.CopyTo(extracted);
See Also
- class ZstandardArchive
- namespace Aspose.Zip.Zstandard
- assembly Aspose.Zip