PowerTCP Zip Compression for .NET
QuickUnzip(Stream,String) Method
Example 




The compressed Stream.
A directory path where decompressed files will be stored.
Opens a compressed archive and decompresses it in one step.
Syntax
<DescriptionAttribute("To load the source stream and decompress it")>
Public Overloads Sub QuickUnzip( _
   ByVal source As Stream, _
   ByVal destination As String _
) 
Dim instance As Archive
Dim source As Stream
Dim destination As String
 
instance.QuickUnzip(source, destination)
[Description("To load the source stream and decompress it")]
public void QuickUnzip( 
   Stream source,
   string destination
)
[Description("To load the source stream and decompress it")]
public: void QuickUnzip( 
   Stream* source,
   string* destination
) 
[Description("To load the source stream and decompress it")]
public:
void QuickUnzip( 
   Stream^ source,
   String^ destination
) 

Parameters

source
The compressed Stream.
destination
A directory path where decompressed files will be stored.
Exceptions
ExceptionDescription
ZipExceptionA critical zip operation error occurred during this activity. Please see ZipException.Message for details.
Remarks

This method is a quick and easy way to use the Archive component to decompress a compressed Stream to a specified destination directory in one step. It combines the two operations of Archive.Open and Archive.Unzip.

The Archive.PreservePath property determines whether to preserve the paths. The Archive.Overwrite property determines whether and how an existing file will be overwritten. By default, the paths will not be preserved and the overwrite choice is Overwrite.Never. The Archive.Password property is used for decrypting the encrypted items.

If an error occurs for an individual item during this operation, the Archive.Exception Event will be raised.

Example
The following example demonstrates using QuickUnzip with a stream destination.
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Zip"
' at the top of your class.

' Preserve the path when unzipping
Archive1.PreservePath = True

' Overwrite any existing files
Archive1.Overwrite = Overwrite.Always

' Create a new stream with compressed data
Dim stream = New System.IO.FileStream("c:\test.zip", System.IO.FileMode.Open)

' Unzip the data in the stream to c:\test
Archive1.QuickUnzip(stream, "c:\Test")
// Be sure to import the namespace by putting "using Dart.PowerTCP.Zip;"
// at the top of your class.

// Preserve the path when unzipping
archive1.PreservePath = true;

// Overwrite any existing files
archive1.Overwrite = Overwrite.Always;

// Create a new stream with compressed data
System.IO.FileStream stream = new System.IO.FileStream("c:\\test.zip", System.IO.FileMode.Open);

// unzip the data in the stream to c:\test
archive1.QuickUnzip(stream, "c:\\Test");
See Also

Reference

Archive Class
Archive Members
Overload List


PowerTCP Zip for .NET Documentation Version 2.1.1
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic