DataServiceContext.BeginGetReadStream Method (Object, DataServiceRequestArgs, AsyncCallback, Object)
Asynchronously gets the binary data stream that belongs to the specified entity, by using the specified message headers.
Namespace: System.Data.Services.Client
Assembly: Microsoft.Data.Services.Client (in Microsoft.Data.Services.Client.dll)
Syntax
'Declaration
Public Function BeginGetReadStream ( _
entity As Object, _
args As DataServiceRequestArgs, _
callback As AsyncCallback, _
state As Object _
) As IAsyncResult
'Usage
Dim instance As DataServiceContext
Dim entity As Object
Dim args As DataServiceRequestArgs
Dim callback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult
returnValue = instance.BeginGetReadStream(entity, _
args, callback, state)
public IAsyncResult BeginGetReadStream(
Object entity,
DataServiceRequestArgs args,
AsyncCallback callback,
Object state
)
public:
IAsyncResult^ BeginGetReadStream(
Object^ entity,
DataServiceRequestArgs^ args,
AsyncCallback^ callback,
Object^ state
)
member BeginGetReadStream :
entity:Object *
args:DataServiceRequestArgs *
callback:AsyncCallback *
state:Object -> IAsyncResult
public function BeginGetReadStream(
entity : Object,
args : DataServiceRequestArgs,
callback : AsyncCallback,
state : Object
) : IAsyncResult
Parameters
- entity
Type: System.Object
The entity that has a the binary data stream to retrieve.
- args
Type: System.Data.Services.Client.DataServiceRequestArgs
Instance of the DataServiceRequestArgs class that contains settings for the HTTP request message.
- callback
Type: System.AsyncCallback
Delegate to invoke when results are available for client consumption.
- state
Type: System.Object
User-defined state object passed to the callback.
Return Value
Type: System.IAsyncResult
An IAsyncResult object that is used to track the status of the asynchronous operation.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Any of the parameters supplied to the method is nulla null reference (Nothing in Visual Basic). |
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 binary data stream. |
Remarks
The GetReadStream method asynchronously requests the binary data stream that belongs to the requested entity.
In the AtomPub protocol, the entity is a Media Link Entry and the binary data stream is the associated Media Resource.
No validation is performed on the headers that are set in args. Therefore, do not change an HTTP header in a way that changes the meaning of the request.