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

StorageWriteStream

abstract class StorageWriteStream : Stream
protected readonly PooledMemoryStream _buffer

protected long _bufferSize

protected long _position

protected readonly IProgress<long> _progressHandler

protected StorageWriteStream(long position, long bufferSize, IProgress<long> progressHandler, UploadTransferValidationOptions transferValidation, PooledMemoryStream buffer = null, ArrayPool<byte> bufferPool = null)

protected static void ValidateWriteParameters(byte[] buffer, int offset, int count)

protected abstract Task AppendInternal(UploadTransferValidationOptions validationOptions, bool async, CancellationToken cancellationToken)

protected virtual Task CommitInternal(bool async, CancellationToken cancellationToken)

Take the checksum of the currnet buffer and reset the tracked checksum calculation.

Note: Avoid using in subclasses. This is only exposed for page blobs, as they override WriteInternal for pageblob 512 requirements. Since WriteInternal is what calls AppendInternal with appropriate validation options, it needs access to this. However, it's not clear whether page blob needs direct access to calling AppendInternal or whether it can call into its base implementation instead. If it can do this, that is preferred and this can be made private.

protected abstract void ValidateBufferSize(long bufferSize)

protected Task WriteToBufferInternal(byte[] buffer, int offset, int count, bool async, CancellationToken cancellationToken)