Method WriteAsync
WriteAsync(T, CancellationToken)
Appends one object; once the buffer is full, it is written to the stream asynchronously.
public ValueTask WriteAsync(T value, CancellationToken cancellationToken = default)
Parameters
valueTThe object.
cancellationTokenCancellationTokenCancels writing the buffer.
Returns
Remarks
If encoding the object throws, nothing of it is kept and the writer stays usable.