แก้ไข

แชร์ผ่าน


ByteArrayContent.SerializeToStreamAsync Method

Definition

Overloads

SerializeToStreamAsync(Stream, TransportContext)

Serialize and write the byte array provided in the constructor to an HTTP content stream as an asynchronous operation.

SerializeToStreamAsync(Stream, TransportContext, CancellationToken)

Serialize and write the byte array provided in the constructor to an HTTP content stream as an asynchronous operation.

SerializeToStreamAsync(Stream, TransportContext)

Source:
ByteArrayContent.cs
Source:
ByteArrayContent.cs
Source:
ByteArrayContent.cs

Serialize and write the byte array provided in the constructor to an HTTP content stream as an asynchronous operation.

protected:
 override System::Threading::Tasks::Task ^ SerializeToStreamAsync(System::IO::Stream ^ stream, System::Net::TransportContext ^ context);
protected override System.Threading.Tasks.Task SerializeToStreamAsync (System.IO.Stream stream, System.Net.TransportContext context);
protected override System.Threading.Tasks.Task SerializeToStreamAsync (System.IO.Stream stream, System.Net.TransportContext? context);
override this.SerializeToStreamAsync : System.IO.Stream * System.Net.TransportContext -> System.Threading.Tasks.Task
Protected Overrides Function SerializeToStreamAsync (stream As Stream, context As TransportContext) As Task

Parameters

stream
Stream

The target stream.

context
TransportContext

Information about the transport, like channel binding token. This parameter may be null.

Returns

The task object representing the asynchronous operation.

Remarks

This operation does not block. When the returned Task object completes, the whole byte array has been written to the stream parameter.

Applies to

SerializeToStreamAsync(Stream, TransportContext, CancellationToken)

Source:
ByteArrayContent.cs
Source:
ByteArrayContent.cs
Source:
ByteArrayContent.cs

Serialize and write the byte array provided in the constructor to an HTTP content stream as an asynchronous operation.

protected:
 override System::Threading::Tasks::Task ^ SerializeToStreamAsync(System::IO::Stream ^ stream, System::Net::TransportContext ^ context, System::Threading::CancellationToken cancellationToken);
protected override System.Threading.Tasks.Task SerializeToStreamAsync (System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken);
override this.SerializeToStreamAsync : System.IO.Stream * System.Net.TransportContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected Overrides Function SerializeToStreamAsync (stream As Stream, context As TransportContext, cancellationToken As CancellationToken) As Task

Parameters

stream
Stream

The target stream.

context
TransportContext

Information about the transport, like channel binding token. This parameter may be null.

cancellationToken
CancellationToken

The cancellation token to cancel the operation.

Returns

The task object representing the asynchronous operation.

Exceptions

The cancellation token was canceled. This exception is stored into the returned task.

Remarks

This operation does not block. When the returned Task object completes, the whole byte array has been written to the stream parameter.

Applies to