IDataServiceStreamProvider.GetReadStream(Object, String, Nullable<Boolean>, DataServiceOperationContext) 方法
定义
返回包含指定实体(即媒体链接项)的媒体资源数据的流。Returns a stream that contains the media resource data for the specified entity, which is a media link entry.
public:
System::IO::Stream ^ GetReadStream(System::Object ^ entity, System::String ^ etag, Nullable<bool> checkETagForEquality, System::Data::Services::DataServiceOperationContext ^ operationContext);
public System.IO.Stream GetReadStream (object entity, string etag, bool? checkETagForEquality, System.Data.Services.DataServiceOperationContext operationContext);
abstract member GetReadStream : obj * string * Nullable<bool> * System.Data.Services.DataServiceOperationContext -> System.IO.Stream
Public Function GetReadStream (entity As Object, etag As String, checkETagForEquality As Nullable(Of Boolean), operationContext As DataServiceOperationContext) As Stream
参数
- entity
- Object
一个实体,它是具有相关媒体资源的媒体链接项。The entity that is a media link entry with a related media resource.
- etag
- String
作为发送到数据服务的 HTTP 请求的一部分发送的 eTag 值。The eTag value sent as part of the HTTP request that is sent to the data service.
一个可以为 null 的 Boolean 值,该值确定数据服务是否必须为所使用的 eTag 类型。A nullable Boolean value that determines whether the data service must the type of eTag that is used.
- operationContext
- DataServiceOperationContext
数据服务用来处理请求的 DataServiceOperationContext 实例。The DataServiceOperationContext instance used by the data service to process the request.
返回
包含 entity 的二进制属性数据的数据 Stream。The data Stream that contains the binary property data of the entity.
注解
eTag 是 If-Match 或 If-None-Match 标头的值。eTag is the value of an If-Match or If-None-Match header. 支持以下值:The following values are supported:
true-如果 eTag 表示 If-match 标头,则为。true- when the eTag represents an If-Match header.false-eTag 表示 "如果-无匹配" 标头。false- when the eTag represents an If-None-Match header.null-如果请求中不存在 If-match 或 If-Match 标头,则为。null- when an If-Match or If-None-Match header is not present in the request.
当客户端请求指定 GetReadStream(这是媒体链接项)的媒体资源时,数据服务方法运行时将调用 entity 方法以获取数据服务返回到客户端的流。The GetReadStream method is called by the data service runtime to acquire the stream that the data service returns to the client when the client requests the media resource for the specified entity, which is a media link entry. 有关详细信息,请参阅流式处理提供程序。For more information, see Streaming Provider.