BsonStreamAdapter.WriteAsync Method (Byte[], Int32, Int32, CancellationToken) (original) (raw)

BsonStreamAdapterWriteAsync Method (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.

Namespace: MongoDB.Bson.IO
Assembly: MongoDB.Bson (in MongoDB.Bson.dll) Version: 2.10.0+569905ff5e778c38ea19d9d0392496a83e1704ed

Syntax

public override Task WriteAsync( byte[] buffer, int offset, int count, CancellationToken cancellationToken )

Public Overrides Function WriteAsync ( buffer As Byte(), offset As Integer, count As Integer, cancellationToken As CancellationToken ) As Task

abstract WriteAsync : buffer : byte[] * offset : int * count : int * cancellationToken : CancellationToken -> Task override WriteAsync : buffer : byte[] * offset : int * count : int * cancellationToken : CancellationToken -> Task

Parameters

buffer

Type: SystemByte
The buffer to write data from.

offset

Type: SystemInt32
The zero-based byte offset in buffer from which to begin copying bytes to the stream.

count

Type: SystemInt32
The maximum number of bytes to write.

cancellationToken

Type: System.ThreadingCancellationToken
The token to monitor for cancellation requests. The default value is None.

Return Value

Type: Task
A task that represents the asynchronous write operation.

Exceptions

See Also

Reference