Dela via


StreamHelperExtensions.DrainAsync Method

Definition

Overloads

DrainAsync(Stream, CancellationToken)

Reads the specified stream to the end.

This API is effective when used in conjunction with buffering. It allows a buffered request stream to be synchronously read after it has been completely drained.

DrainAsync(Stream, Nullable<Int64>, CancellationToken)

Reads the specified stream to the end.

This API is effective when used in conjunction with buffering. It allows a buffered request stream to be synchronously read after it has been completely drained.

DrainAsync(Stream, ArrayPool<Byte>, Nullable<Int64>, CancellationToken)

Reads the specified stream to the end.

This API is effective when used in conjunction with buffering. It allows a buffered request stream to be synchronously read after it has been completely drained.

DrainAsync(Stream, CancellationToken)

Source:
StreamHelperExtensions.cs
Source:
StreamHelperExtensions.cs
Source:
StreamHelperExtensions.cs

Reads the specified stream to the end.

This API is effective when used in conjunction with buffering. It allows a buffered request stream to be synchronously read after it has been completely drained.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ DrainAsync(System::IO::Stream ^ stream, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.Task DrainAsync (this System.IO.Stream stream, System.Threading.CancellationToken cancellationToken);
static member DrainAsync : System.IO.Stream * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function DrainAsync (stream As Stream, cancellationToken As CancellationToken) As Task

Parameters

stream
Stream

The Stream to completely read.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

Applies to

DrainAsync(Stream, Nullable<Int64>, CancellationToken)

Source:
StreamHelperExtensions.cs
Source:
StreamHelperExtensions.cs
Source:
StreamHelperExtensions.cs

Reads the specified stream to the end.

This API is effective when used in conjunction with buffering. It allows a buffered request stream to be synchronously read after it has been completely drained.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ DrainAsync(System::IO::Stream ^ stream, Nullable<long> limit, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.Task DrainAsync (this System.IO.Stream stream, long? limit, System.Threading.CancellationToken cancellationToken);
static member DrainAsync : System.IO.Stream * Nullable<int64> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function DrainAsync (stream As Stream, limit As Nullable(Of Long), cancellationToken As CancellationToken) As Task

Parameters

stream
Stream

The Stream to completely read.

limit
Nullable<Int64>

The maximum number of bytes to read. Throws if the Stream is larger than this limit.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

Applies to

DrainAsync(Stream, ArrayPool<Byte>, Nullable<Int64>, CancellationToken)

Source:
StreamHelperExtensions.cs
Source:
StreamHelperExtensions.cs
Source:
StreamHelperExtensions.cs

Reads the specified stream to the end.

This API is effective when used in conjunction with buffering. It allows a buffered request stream to be synchronously read after it has been completely drained.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ DrainAsync(System::IO::Stream ^ stream, System::Buffers::ArrayPool<System::Byte> ^ bytePool, Nullable<long> limit, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.Task DrainAsync (this System.IO.Stream stream, System.Buffers.ArrayPool<byte> bytePool, long? limit, System.Threading.CancellationToken cancellationToken);
static member DrainAsync : System.IO.Stream * System.Buffers.ArrayPool<byte> * Nullable<int64> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function DrainAsync (stream As Stream, bytePool As ArrayPool(Of Byte), limit As Nullable(Of Long), cancellationToken As CancellationToken) As Task

Parameters

stream
Stream

The Stream to completely read.

bytePool
ArrayPool<Byte>

The byte array pool to use.

limit
Nullable<Int64>

The maximum number of bytes to read. Throws if the Stream is larger than this limit.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

Applies to