ZArchive.ZArchive

ZArchive()

Initializes a new instance of the ZArchive class prepared for compressing.

public ZArchive()

See Also


ZArchive(Stream, ZArchiveLoadOptions)

Initializes a new instance of the ZArchive class prepared for decompressing.

public ZArchive(Stream source, ZArchiveLoadOptions loadOptions = null)
ParameterTypeDescription
sourceStreamThe source of the archive.
loadOptionsZArchiveLoadOptionsThe options to load archive with.

Exceptions

exceptioncondition
ArgumentExceptionsource is not seekable.
ArgumentNullExceptionsource is null.

Remarks

This constructor does not decompress. See Extract method for decompressing.

See Also


ZArchive(string, ZArchiveLoadOptions)

Initializes a new instance of the ZArchive class prepared for decompressing.

public ZArchive(string path, ZArchiveLoadOptions loadOptions = null)
ParameterTypeDescription
pathStringPath to the source of the archive.
loadOptionsZArchiveLoadOptionsThe options to load archive with.

Exceptions

exceptioncondition
ArgumentNullExceptionpath is null.
SecurityExceptionThe caller does not have the required permission to access.
ArgumentExceptionThe path is empty, contains only white spaces, or contains invalid characters.
UnauthorizedAccessExceptionAccess to file path is denied.
PathTooLongExceptionThe specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
NotSupportedExceptionFile at path contains a colon (:) in the middle of the string.
FileNotFoundExceptionThe file is not found.
DirectoryNotFoundExceptionThe specified path is invalid, such as being on an unmapped drive.
IOExceptionThe file is already open.

Remarks

This constructor does not decompress. See Extract method for decompressing.

See Also