I think the secret to your problem lies in the return value of outputStream.Read
- which is likely returning 0.
I would try the following code instead:
using (System.IO.Stream outputStream = new System.IO.MemoryStream())
{
cloudFilesProvider.GetObject(inIntStoreID.ToString(), inStrFileName, outputStream);
byte[] bytes = new byte[outputStream.Length];
outputStream.Seek(0, SeekOrigin.Begin);
int length = outputStream.Read(bytes, 0, bytes.Length);
if (length < bytes.Length)
Array.Resize(ref bytes, length);
File.WriteAllBytes(strSrcFilePath, bytes);
}