InputStream Property

DotNetZip

Ionic Zip Library v1.9.1.6 InputStream Property
ReferenceIonic.ZipZipEntryInputStream
The stream that provides content for the ZipEntry.
Declaration Syntax
C# Visual Basic Visual C++
public Stream InputStream { get; set; }
Public Property InputStream As Stream
	Get
	Set
public:
property Stream^ InputStream {
	Stream^ get ();
	void set (Stream^ value);
}
Remarks

The application can use this property to set the input stream for an entry on a just-in-time basis. Imagine a scenario where the application creates a ZipFile comprised of content obtained from hundreds of files, via calls to AddFile(). The DotNetZip library opens streams on these files on a just-in-time basis, only when writing the entry out to an external store within the scope of a ZipFile.Save() call. Only one input stream is opened at a time, as each entry is being written out.

Now imagine a different application that creates a ZipFile with content obtained from hundreds of streams, added through AddEntry(String, Stream). Normally the application would supply an open stream to that call. But when large numbers of streams are being added, this can mean many open streams at one time, unnecessarily.

To avoid this, call AddEntry(String, OpenDelegate, CloseDelegate) and specify delegates that open and close the stream at the time of Save.

Setting the value of this property when the entry was not added from a stream (for example, when the ZipEntry was added with AddFile(String) or AddDirectory(String), or when the entry was added by reading an existing zip archive) will throw an exception.

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)