Azure Blob storage: DownloadToByteArray VS DownloadToStream

后端 未结 3 1352
别跟我提以往
别跟我提以往 2021-01-31 14:42

I have been playing with the Azure Blob Storage service to save/recover files in a context of a web page to be hosted in Azure Web Pages.

During the learning process I h

3条回答
  •  我在风中等你
    2021-01-31 15:28

    If you are planning to use the DownloadToBytesArray (async or not), you will have to fetch blob attributes first to get an initial size of byte array.

    And if you will be using DownloadToStream you will not have to do that. That's one saved HTTP call to the blob storage and if I am not mistaken, FetchAttributes() is executed as HTTP HEAD request and that will count as a normal transaction (it will cost you some money in other words).

提交回复
热议问题