PowerTCP Zip Compression for .NET
Open(Stream) Method
Example 




The compressed Stream to be opened.
Opens a compressed archive and populates the collection to reflect the items in the compressed archive.
Syntax
<DescriptionAttribute("To load the given source stream archive to the collection for further manipulation.")>
Public Overloads Sub Open( _
   ByVal zipArchive As Stream _
) 
Dim instance As Archive
Dim zipArchive As Stream
 
instance.Open(zipArchive)
[Description("To load the given source stream archive to the collection for further manipulation.")]
public void Open( 
   Stream zipArchive
)
[Description("To load the given source stream archive to the collection for further manipulation.")]
public: void Open( 
   Stream* zipArchive
) 
[Description("To load the given source stream archive to the collection for further manipulation.")]
public:
void Open( 
   Stream^ zipArchive
) 

Parameters

zipArchive
The compressed Stream to be opened.
Remarks

This overload is intended to open Stream-based classes and populate the Archive collection.

Please note that an Open operation will clear any pre-existing items in the collection.

If a zip operation is executed with a stream destination, and that destination stream is the same as the zipArchive stream, the zipArchive stream will be overwritten with the resultant compressed data.

Example
The following example demonstrates loading a compressed file and unzipping the file.
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Zip"
' at the top of your class.

' Open a compressed stream.  This populates the Archive collection.
Archive1.Open("c:\test.zip")

' Preserve the path structure and overwrite any existing files.
Archive1.PreservePath = True
Archive1.Overwrite = Overwrite.Always

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

// Open a compressed stream.  This populates the Archive collection.
archive1.Open("c:\\test.zip");

// Preserve the path structure and overwrite any existing files.
archive1.PreservePath = true;
archive1.Overwrite = Overwrite.Always;

// Unzip to c:\test
archive1.Unzip("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