Class DataStreamReader
Default class for DataStream readers.
Inheritance
System.Object
DataStreamReader
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Data.IO.DataStreams
Assembly: Kephas.Data.IO.dll
Syntax
[ProcessingPriority(Priority.Low)]
public class DataStreamReader : IDataStreamReader
Constructors
| Improve this Doc View SourceDataStreamReader(ICompositionContext, ISerializationService, IMediaTypeProvider)
Initializes a new instance of the DataStreamReader class.
Declaration
public DataStreamReader(ICompositionContext compositionContext, ISerializationService serializationService, IMediaTypeProvider mediaTypeProvider)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | Context for the composition. |
ISerializationService | serializationService | The serialization service. |
IMediaTypeProvider | mediaTypeProvider | The media type provider. |
Methods
| Improve this Doc View SourceCanRead(DataStream)
Determines whether this instance can read the specified DataStream.
Declaration
public virtual bool CanRead(DataStream dataStream)
Parameters
Type | Name | Description |
---|---|---|
DataStream | dataStream | The DataStream. |
Returns
Type | Description |
---|---|
System.Boolean |
|
CreateEncodedStreamReader(DataStream)
Creates the encoded stream reader.
Declaration
protected virtual StreamReader CreateEncodedStreamReader(DataStream dataStream)
Parameters
Type | Name | Description |
---|---|---|
DataStream | dataStream | The data source. |
Returns
Type | Description |
---|---|
System.IO.StreamReader | The encoded stream reader. |
GetMediaType(DataStream)
Gets the media type for the DataStream.
Declaration
protected virtual Type GetMediaType(DataStream dataStream)
Parameters
Type | Name | Description |
---|---|---|
DataStream | dataStream | The DataStream. |
Returns
Type | Description |
---|---|
System.Type | The media type. |
ReadAsync(DataStream, IDataIOContext, CancellationToken)
Reads the data source and converts it to an enumeration of client entities.
Declaration
public virtual Task<object> ReadAsync(DataStream dataStream, IDataIOContext context = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
DataStream | dataStream | The DataStream containing the entities. |
IDataIOContext | context | The data I/O context. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | A promise of the deserialized entities. |