SeekableStreamWriteAsync(Byte, Int32, Int32, CancellationToken) - метод

Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.

Definition

Пространство имён: Tessa.Platform.IO
Сборка: Tessa (в Tessa.dll) Версия: 4.0.4
C#
public override Task WriteAsync(
	byte[] buffer,
	int offset,
	int count,
	CancellationToken cancellationToken
)

Параметры

buffer  Byte
The buffer to write data from.
offset  Int32
The zero-based byte offset in buffer from which to begin copying bytes to the stream.
count  Int32
The maximum number of bytes to write.
cancellationToken  CancellationToken
The token to monitor for cancellation requests. The default value is None.

Возвращаемое значение

Task
A task that represents the asynchronous write operation.

Исключения

ArgumentNullExceptionbuffer is .
ArgumentOutOfRangeExceptionoffset or count is negative.
ArgumentExceptionThe sum of offset and count is larger than the buffer length.
NotSupportedExceptionThe stream does not support writing.
ObjectDisposedExceptionThe stream has been disposed.
InvalidOperationExceptionThe stream is currently in use by a previous write operation.

См. также