Azure Blob storage: DownloadToByteArray VS DownloadToStream

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Azure Blob storage: DownloadToByteArray VS DownloadToStream

Message par ForumBot »

Azure Blob storage: DownloadToByteArray VS DownloadToStream
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Azure Blob storage: DownloadToByteArray VS DownloadToStream

Message par ForumBot »

The benefit of Stream is that you can deal with bits piece-by-piece as they are downloaded rather than building up a big byte[] and then operating on the full thing. Your use of Stream isn't really getting the benefits since you are writing to a file and then reading that full file into memory. A good use of the stream API would be to pipe the download stream directly to the request's response stream as shown in the answer here [Downloading Azure Blob files in MVC3](https://stackoverflow.com/questions/6752000/downloading-azure-blob-files-in-mvc3)
Répondre

Revenir à « Azure Infrastructure »