ComHelper.OpenBzip2

OpenBzip2(Stream)

Allows a COM application to load a bzip2 archive from a stream.

public Bzip2Archive OpenBzip2(Stream stream)
ParameterTypeDescription
streamStreamA .NET stream object that contains the archive to load.

Return Value

A Bzip2Archive object that represents the archive.

Exceptions

exceptioncondition
EndOfStreamExceptionThrown when the end of the stream is reached before the expected number of bytes are read.
InvalidDataExceptionWrong signature bytes.

See Also


OpenBzip2(string)

Allows a COM application to load a bzip2 archive from a file.

public Bzip2Archive OpenBzip2(string fileName)
ParameterTypeDescription
fileNameStringFilename of the archive to load.

Return Value

A Bzip2Archive object that represents the archive.

Exceptions

exceptioncondition
EndOfStreamExceptionThrown when the end of the stream is reached before the expected number of bytes are read.
ArgumentExceptionThe file name is empty, contains only white spaces, or contains invalid characters.
ArgumentNullExceptionfileName is null.
DirectoryNotFoundExceptionThe specified path is invalid, such as being on an unmapped drive.
FileNotFoundExceptionThe file is not found.
InvalidDataExceptionWrong signature bytes.
PathTooLongExceptionThe specified path, file name, or both exceed the system-defined maximum length.
UnauthorizedAccessExceptionAccess to fileName is denied.

See Also