public Stream GetItemDataStream()
Return Value
A read-only System.IO.Stream object.
The method creates a new read-only, non-seeking stream object based on the ZipReader instance's current item. Each call to the stream's Stream.Read method will call ReadItemData.
The method allows you to use the Stream class interface to read item data from ZipReader instead of using ReadItemData() directly. This makes it possible to integrate ZipReader with other classes that use the Stream class interface without the need for "glue code."
Dispose should be called on the stream when all the current item's data has been read.
The stream returned by the method should be considered unique to the current item. This means you should not reuse the stream with later items. Instead, get a new stream instance by calling the method again. The example below illustrates this.
ReadItemData can still be called to read data even if this method is used. This can be done after the stream returned by the method has been closed or even while the stream is active.
The method can be used to read nested zip archives with ZipReader. A nested zip archive is when an item in an archive is another zip archive. By providing the stream returned by the method to a new instance of ZipReader, a nested zip archive will be read. See this page for an example.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2