Closes the current ZipArchive object and releases any resources associated with it (file or stream).

Namespace:  Rebex.IO.Compression
Assembly:  Rebex.Zip (in Rebex.Zip.dll)

Syntax

Visual Basic
Public Sub Close ( _
	action As ArchiveSaveAction _
)
C#
public void Close(
	ArchiveSaveAction action
)

Parameters

action
Type: Rebex.IO.Compression..::..ArchiveSaveAction
Save action. Specifies whether to save pending changes and shrink the ZIP archive.

Remarks

Note that underlying stream is not closed if the ZipArchive isn't its owner (if the constructor was called with the leaveOpen argument of true).

Exceptions

ExceptionCondition
System..::..ArgumentOutOfRangeExceptionThe action specified an invalid value.
System..::..InvalidOperationExceptionAttempt to shrink the archive, but archive is not opened for writing.
System.IO..::..IOExceptionAn I/O error occurred while shrinking the archive.
Rebex.IO.Compression..::..ZipExceptionCannot perform the requested operation (see ProblemType for detailed information).

Version Information

.NET Framework

Supported in: 4.8, 4.7.x, 4.6.x, 4.5.x, 4.0, 3.5 SP1

.NET Standard 2.0

Supported in: .NET Core 3.1, 3.0, 2.1; Xamarin.Android 9.1 (or higher); Xamarin.iOS 10.3 (or higher)

See Also