Click or drag to resize
WriteBufferReserveAsync Method
Asynchronously ensures that size <= (Capacity - Count).

Namespace: Lawo.IO
Assembly: Lawo (in Lawo.dll) Version: 1.4.1707.27006
Syntax
C#
public Task ReserveAsync(
	int size,
	CancellationToken cancellationToken
)

Parameters

size
Type: SystemInt32
The minimum number of bytes to reserve.
cancellationToken
Type: System.ThreadingCancellationToken
The token to monitor for cancellation requests.

Return Value

Type: Task
Exceptions
ExceptionCondition
InvalidOperationExceptionThe WriteBuffer object was created by calling WriteBuffer(WriteCallback, Int32).
Remarks
Performs the following steps:
  1. If size > (Capacity - Count), then calls FlushAsync(CancellationToken).
  2. If size > Capacity, then enlarges the buffer such that it can hold at least size bytes.
See Also