ZipArchive Constructor (Stream, ZipArchiveMode, Boolean)

Initializes a new instance of ZipArchive on the given stream in the specified mode, specifying whether to leave the stream open.

Namespace:  Microsoft.TeamFoundation.Framework.Server
Assembly:  Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)

Syntax

'Declaration
Public Sub New ( _
    stream As Stream, _
    mode As ZipArchiveMode, _
    leaveOpen As Boolean _
)
public ZipArchive(
    Stream stream,
    ZipArchiveMode mode,
    bool leaveOpen
)
public:
ZipArchive(
    Stream^ stream, 
    ZipArchiveMode mode, 
    bool leaveOpen
)
new : 
        stream:Stream * 
        mode:ZipArchiveMode * 
        leaveOpen:bool -> ZipArchive
public function ZipArchive(
    stream : Stream, 
    mode : ZipArchiveMode, 
    leaveOpen : boolean
)

Parameters

  • mode
    Type: Microsoft.TeamFoundation.Framework.Server.ZipArchiveMode

    See the description of the ZipArchiveMode enum. Read requires the stream to support reading, Create requires the stream to support writing, and Update requires the stream to support reading, writing, and seeking.

  • leaveOpen
    Type: System.Boolean

    true to leave the stream open upon disposing the ZipArchive, otherwise false.

Exceptions

Exception Condition
ArgumentException

The stream is already closed, or mode is incompatible with the capabilities of the stream.

ArgumentNullException

The stream is null.

ArgumentOutOfRangeException

mode specified an invalid value.

InvalidDataException

The contents of the stream could not be interpreted as a Zip file, or mode is Update and an entry is missing from the archive or is corrupted and cannot be read, or mode is Update and an entry is too large to fit into memory.

.NET Framework Security

See Also

Reference

ZipArchive Class

ZipArchive Overload

Microsoft.TeamFoundation.Framework.Server Namespace