Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DataServiceContext.GetReadStream Method (Object, String)

Gets the binary data stream that belongs to the specified entity, by using the specified Content-Type message header.

Namespace:  System.Data.Services.Client
Assembly:  Microsoft.Data.Services.Client (in Microsoft.Data.Services.Client.dll)
public DataServiceStreamResponse GetReadStream(
	Object entity,
	string acceptContentType
)

Parameters

entity
Type: System.Object
The entity that has the binary data stream to retrieve.
acceptContentType
Type: System.String
The Content-Type of the binary data stream 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.
ExceptionCondition
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 related stream.

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

The GetReadStream method synchronously requests the related binary data stream for the entity.

In the AtomPub protocol, the entity is a Media Link Entry and the binary stream 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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.