SPFile.OpenBinaryStream Method (SPOpenBinaryOptions, String, String)
Opens the file as a stream based on the specified options.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Available in SharePoint Online
Syntax
'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedSPType)> _
Public Function OpenBinaryStream ( _
openOptions As SPOpenBinaryOptions, _
etagNotMatch As String, _
<OutAttribute> ByRef etagNew As String _
) As Stream
'Usage
Dim instance As SPFile
Dim openOptions As SPOpenBinaryOptions
Dim etagNotMatch As String
Dim etagNew As String
Dim returnValue As Stream
returnValue = instance.OpenBinaryStream(openOptions, _
etagNotMatch, etagNew)
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedSPType)]
public Stream OpenBinaryStream(
SPOpenBinaryOptions openOptions,
string etagNotMatch,
out string etagNew
)
Parameters
openOptions
Type: Microsoft.SharePoint.SPOpenBinaryOptionsOptions to use when opening the file.
etagNotMatch
Type: System.StringThe ETag value to use for not match. If a null reference (Nothing in Visual Basic), the file is always opened. If not a null reference (Nothing in Visual Basic) and the match operation fails, an exception is thrown.
etagNew
Type: System.StringWhen this method returns, contains a String that is the ETag value of the newly opened file. This parameter is passed uninitialized.
Return Value
Type: System.IO.Stream
An System.IO.Stream object that represents the file.