MediaTypeFormatter::ReadFromStreamAsync Method
Namespace:
System.Net.Http.Formatting
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
| Name | Description | |
|---|---|---|
![]() | ReadFromStreamAsync(Type^, Stream^, HttpContent^, IFormatterLogger^) | Asynchronously deserializes an object of the specified type. |
![]() | ReadFromStreamAsync(Type^, Stream^, HttpContent^, IFormatterLogger^, CancellationToken) | Asynchronously deserializes an object of the specified type. |
MediaTypeFormatter::ReadFromStreamAsync Method (Type^, Stream^, HttpContent^, IFormatterLogger^)
Asynchronously deserializes an object of the specified type.
public: virtual Task<Object^>^ ReadFromStreamAsync( Type^ type, Stream^ readStream, HttpContent^ content, IFormatterLogger^ formatterLogger )
Parameters
- type
-
Type:
System::Type^
The type of the object to deserialize.
- readStream
-
Type:
System.IO::Stream^
The Stream to read.
- content
-
Type:
System.Net.Http::HttpContent^
The HttpContent, if available. It may be null.
- formatterLogger
-
Type:
System.Net.Http.Formatting::IFormatterLogger^
The IFormatterLogger to log events to.
Return Value
Type: System.Threading.Tasks::Task<Object^>^A Task whose result will be an object of the given type.
| Exception | Condition |
|---|---|
| NotSupportedException | Derived types need to support reading. |
MediaTypeFormatter::ReadFromStreamAsync Method (Type^, Stream^, HttpContent^, IFormatterLogger^, CancellationToken)
Asynchronously deserializes an object of the specified type.
public: virtual Task<Object^>^ ReadFromStreamAsync( Type^ type, Stream^ readStream, HttpContent^ content, IFormatterLogger^ formatterLogger, CancellationToken cancellationToken )
Parameters
- type
-
Type:
System::Type^
The type of the object to deserialize.
- readStream
-
Type:
System.IO::Stream^
The Stream to read.
- content
-
Type:
System.Net.Http::HttpContent^
The HttpContent, if available. It may be null.
- formatterLogger
-
Type:
System.Net.Http.Formatting::IFormatterLogger^
The IFormatterLogger to log events to.
- cancellationToken
-
Type:
System.Threading::CancellationToken
The token to cancel the operation.
Return Value
Type: System.Threading.Tasks::Task<Object^>^A Task whose result will be an object of the given type.
Show:
