Class ComHelper
Namespace: Aspose.Zip
Assembly: Aspose.Zip.dll (26.3.0)
Provides methods for COM clients to load archives into Aspose.Zip.
public class ComHelperInheritance
Inherited Members
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Remarks
Use the ComHelper class to load an archive from a file or stream. Particular classes provide a default constructor to create a new archive and also provides overloaded constructors to load an archive from a file or stream. If you are using Aspose.Zip from a .NET application, you can use all the archive constructors directly, but if you are using Aspose.Zip from a COM application, only the default archive constructor is available.
Constructors
ComHelper()
Initializes a new instance of this class.
public ComHelper()Methods
OpenBzip2(Stream)
Allows a COM application to load a bzip2 archive from a stream.
public Bzip2Archive OpenBzip2(Stream stream)Parameters
stream Stream
A .NET stream object that contains the archive to load.
Returns
A Aspose.Zip.Bzip2.Bzip2Archive object that represents the archive.
Exceptions
Thrown when the end of the stream is reached before the expected number of bytes are read.
Wrong signature bytes.
OpenBzip2(string)
Allows a COM application to load a bzip2 archive from a file.
public Bzip2Archive OpenBzip2(string fileName)Parameters
fileName string
Filename of the archive to load.
Returns
A Aspose.Zip.Bzip2.Bzip2Archive object that represents the archive.
Exceptions
Thrown when the end of the stream is reached before the expected number of bytes are read.
The file name is empty, contains only white spaces, or contains invalid characters.
fileName is null.
The specified path is invalid, such as being on an unmapped drive.
The file is not found.
Wrong signature bytes.
The specified path, file name, or both exceed the system-defined maximum length.
Access to fileName is denied.
OpenGzip(Stream)
Allows a COM application to load a gzip archive from a stream.
public GzipArchive OpenGzip(Stream stream)Parameters
stream Stream
A .NET stream object that contains the archive to load.
Returns
A Aspose.Zip.Gzip.GzipArchive object that represents the archive.
Exceptions
Thrown when the end of the stream is reached before the expected number of bytes are read.
Thrown when an stream is null.
Thrown when the data is invalid or corrupted.
OpenGzip(string)
Allows a COM application to load a gzip archive from a file.
public GzipArchive OpenGzip(string fileName)Parameters
fileName string
Filename of the archive to load.
Returns
A Aspose.Zip.Gzip.GzipArchive object that represents the archive.
Exceptions
Thrown when the end of the stream is reached before the expected number of bytes are read.
The file name is empty, contains only white spaces, or contains invalid characters.
fileName is null.
The specified path is invalid, such as being on an unmapped drive.
The file is not found.
Thrown when the data is invalid or corrupted.
The specified path, file name, or both exceed the system-defined maximum length.
Access to fileName is denied.
OpenRar(Stream)
Allows a COM application to load a rar archive from a stream.
public RarArchive OpenRar(Stream stream)Parameters
stream Stream
A .NET stream object that contains the archive to load.
Returns
A Aspose.Zip.Rar.RarArchive object that represents the archive.
Exceptions
Thrown when the data is invalid or corrupted.
OpenRar(string)
Allows a COM application to load a rar archive from a file.
public RarArchive OpenRar(string fileName)Parameters
fileName string
Filename of the archive to load.
Returns
A Aspose.Zip.Rar.RarArchive object that represents the archive.
Exceptions
The file name is empty, contains only white spaces, or contains invalid characters.
fileName is null.
Thrown when a runtime error occurs.
The specified path is invalid, such as being on an unmapped drive.
The file is not found.
Thrown when the data is invalid or corrupted.
The specified path, file name, or both exceed the system-defined maximum length.
Access to fileName is denied.
OpenZip(Stream)
Allows a COM application to load a ZIP archive from a stream.
public Archive OpenZip(Stream stream)Parameters
stream Stream
A .NET stream object that contains the archive to load.
Returns
A Aspose.Zip.Archive object that represents the archive.
Exceptions
Thrown when the end of the stream is reached before the expected number of bytes are read.
OpenZip(string)
Allows a COM application to load a ZIP archive from a file.
public Archive OpenZip(string fileName)Parameters
fileName string
Filename of the archive to load.
Returns
A Aspose.Zip.Archive object that represents the archive.
Exceptions
Thrown when the end of the stream is reached before the expected number of bytes are read.
The file name is empty, contains only white spaces, or contains invalid characters.
fileName is null.
The specified path is invalid, such as being on an unmapped drive.
The file is not found.
The specified path, file name, or both exceed the system-defined maximum length.
Access to fileName is denied.