Creates a new zip file in a stream.

Namespace:  C1.C1Zip
Assembly:  C1.Silverlight.Zip (in C1.Silverlight.Zip.dll)

Syntax

C#
public void Create(
	Stream stream
)
Visual Basic
Public Sub Create ( _
	stream As Stream _
)

Parameters

stream
Type: System.IO..::..Stream
Stream that will contain the new zip file.

Examples

The code below creates a new C1ZipFile on a memory stream, then adds several files to it. Finally, the code gets the zipped data out as an array of bytes, which could be stored in a database for example.
Copy CodeC#
// create zip on a stream
MemoryStream msZip = new MemoryStream();
C1ZipFile zip = new C1ZipFile(msZip, true);

// add some entries to it
foreach (string f in Directory.GetFiles(@"c:\WINDOWS\Web\Wallpaper"))
{
  zip.Entries.Add(f);
}

// get zipped data out as a byte array
byte[] zipData = msZip.ToArray();

See Also