/// <summary> Write a stream to a store. </summary> /// <remarks> Reads forward from the current position of the stream. </remarks> public static Task <WrittenBlob> WriteAsync( this IWriteOnlyStore store, Stream stream, CancellationToken cancel) => // Default buffer size is 4MB, because Azure Storage likes it. store.WriteAsync(stream, 4 * 1024 * 1024, cancel);
/// <summary> Write an entire buffer of bytes to the store. </summary> public static Task <WrittenBlob> WriteAsync( this IWriteOnlyStore store, byte[] buffer, CancellationToken cancel) => store.WriteAsync(buffer, 0, buffer.Length, cancel);