Skip to content

Commit 874e0ad

Browse files
Update append blob sample
1 parent 102ce9a commit 874e0ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/storage/blobs/storage-blob-append.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ static async Task AppendToBlob(
5151
while (bytesLeft > 0)
5252
{
5353
int blockSize = (int)Math.Min(bytesLeft, maxBlockSize);
54-
int bytesRead = await logEntryStream.ReadAsync(buffer, 0, blockSize);
55-
using (MemoryStream memoryStream = new MemoryStream(buffer, 0, bytesRead))
54+
int bytesRead = await logEntryStream.ReadAsync(buffer.AsMemory(0, blockSize));
55+
await using (MemoryStream memoryStream = new MemoryStream(buffer, 0, bytesRead))
5656
{
5757
await appendBlobClient.AppendBlockAsync(memoryStream);
5858
}

0 commit comments

Comments
 (0)