DataServiceContext.GetReadStream Method (Object, String) (System.Data.Services.Client)

Switch View :
ScriptFree
.NET Framework Class Library
DataServiceContext.GetReadStream Method (Object, String)

Gets binary property data for the specified entity as a data stream, with the specified Accept message header.

Namespace:  System.Data.Services.Client
Assembly:  System.Data.Services.Client (in System.Data.Services.Client.dll)
Syntax

Visual Basic
Public Function GetReadStream ( _
	entity As Object, _
	acceptContentType As String _
) As DataServiceStreamResponse
C#
public DataServiceStreamResponse GetReadStream(
	Object entity,
	string acceptContentType
)
Visual C++
public:
DataServiceStreamResponse^ GetReadStream(
	Object^ entity, 
	String^ acceptContentType
)
F#
member GetReadStream : 
        entity:Object * 
        acceptContentType:string -> DataServiceStreamResponse 

Parameters

entity
Type: System.Object
The entity that has the binary property to retrieve.
acceptContentType
Type: System.String
The content type of the data requested from the data service, specified in the Accept header.

Return Value

Type: System.Data.Services.Client.DataServiceStreamResponse
An instance of DataServiceStreamResponse that represents the response.
Exceptions

Exception Condition
ArgumentNullException

entity is null.

-or-

acceptContentType is null.

ArgumentException

The entity is not tracked by this DataServiceContext.

-or-

The entity is in the Added state.

-or-

The entity is not a Media Link Entry and does not have a binary property.

Remarks

The acceptContentType parameter should be a valid value for the Accept HTTP header.

The GetReadStream method synchronously requests a data stream that contains the binary property of the requested entity.

In the AtomPub protocol, the entity is a Media Link Entry and the binary property is the associated Media Resource.

No validation is performed on the headers that are set in acceptContentType. Therefore, do not change this HTTP header in a way that changes the meaning of the request.

Version Information

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4
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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also

Reference