WindowsAzure/azure-sdk-for-net — pull request #210 by kpfaulkner (2013-05-28 10:07:17+00:00)
Title: Issue #206

Flushing otherwise downloaded blob is often missing bytes off the end
after download.

Issue with bug is easily replicated and have found that all bytes are downloaded fine but not successfully written to the output stream. Adding in a flush (didn't use flushasync) at the end of ExecuteAsyncInternal after the writing has occurred fixes the problem. Haven't tested all code paths, but just did the fix to test out the idea. Seems solid enough.

Hope it's useful.