Bzip2Archive.Open
Contents
[
Hide
]Bzip2Archive.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.
Exceptions
exception | condition |
---|---|
ObjectDisposedException | Archive has been disposed and cannot be used. |
Remarks
Read from the stream to get the original content of the file. See examples section.
Examples
Usage:
Stream decompressed = archive.Open();
.NET 4.0 and higher - use Stream.CopyTo method:
decompressed.CopyTo(httpResponse.OutputStream)
.NET 3.5 and before - copy bytes manually:
byte[] buffer = new byte[8192];
int bytesRead;
while (0 < (bytesRead = decompressed.Read(buffer, 0, buffer.Length)))
fileStream.Write(buffer, 0, bytesRead);
See Also
- class Bzip2Archive
- namespace Aspose.Zip.Bzip2
- assembly Aspose.Zip