Skip to content

Commit c6a9f60

Browse files
Merge pull request #251699 from pauljewellmsft/append-sample
Update append blob sample
2 parents 708c0ae + d8e0d69 commit c6a9f60

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)