PackagePart.GetStream Method


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Returns the part content data stream.

Namespace:   System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)


Returns the part content data stream.


Returns the content stream opened in a specified I/O FileMode.

System_CAPS_pubmethodGetStream(FileMode, FileAccess)

Returns the part content stream opened with a specified FileMode and FileAccess.

Notes to Callers:

GetStream internally calls the derived GetStreamCore method to actually open and return the part data stream based on the physical format implemented in the derived class.

By default, the ZipPackagePart subclass implementation of the abstract PackagePart class is provided and used. In the default operation, GetStream internally calls GetStreamCore of the ZipPackagePart class to open and return the part data stream from a ZIP file.

Return to top