<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />

AppendBlobWriteStream

using Azure.Storage.Blobs.Models; using Azure.Storage.Blobs.Specialized; using Azure.Storage.Shared; using System; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; namespace Azure.Storage.Blobs { internal class AppendBlobWriteStream : StorageWriteStream { private readonly AppendBlobClient _appendBlobClient; private readonly AppendBlobRequestConditions _conditions; public AppendBlobWriteStream(AppendBlobClient appendBlobClient, long bufferSize, long position, AppendBlobRequestConditions conditions, IProgress<long> progressHandler, UploadTransferValidationOptions transferValidation) : base(position, bufferSize, progressHandler, transferValidation, null, null) { ValidateBufferSize(bufferSize); _appendBlobClient = appendBlobClient; _conditions = (conditions ?? new AppendBlobRequestConditions()); } [AsyncStateMachine(typeof(<AppendInternal>d__3))] protected override Task AppendInternal(UploadTransferValidationOptions validationOptions, bool async, CancellationToken cancellationToken) { <AppendInternal>d__3 stateMachine = default(<AppendInternal>d__3); stateMachine.<>t__builder = AsyncTaskMethodBuilder.Create(); stateMachine.<>4__this = this; stateMachine.validationOptions = validationOptions; stateMachine.async = async; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } protected override void ValidateBufferSize(long bufferSize) { if (bufferSize < 1) throw new ArgumentOutOfRangeException("bufferSize", "Must be greater than or equal to 1"); if (bufferSize > 104857600) throw new ArgumentOutOfRangeException("bufferSize", $"""{104857600}"); } } }