/// <summary> /// Downloads the BLOB. /// </summary> /// <param name="blob">The BLOB.</param> /// <param name="fetchAttribute">if set to <c>true</c> [fetch attribute].</param> /// <param name="metaData">The meta data.</param> /// <returns>System.Byte[].</returns> public static byte[] DownloadBlob(CloudBlockBlob blob, bool fetchAttribute, out IDictionary<string, string> metaData) { try { blob.CheckNullObject("blob"); if (fetchAttribute) { blob.FetchAttributes(); metaData = blob.Metadata; } else { metaData = null; } var msRead = new MemoryStream { Position = 0 }; using (msRead) { blob.DownloadToStream(msRead); return msRead.ToBytes(); } } catch (Exception ex) { throw ex.Handle("DownloadBlob", blob.Uri.ToString()); } }