Azure Blob存储:缓冲区不能为空

时间:2016-12-29 02:48:24

标签: azure xamarin xamarin.forms azure-storage-blobs

我正在关注来自Xamarin for Azure的源代码:FileUploader用于图片上传,我尝试运行该应用程序,错误显示缓冲区不能为空。 如下图所示:

enter image description here

1 个答案:

答案 0 :(得分:0)

我建议,创建“MemoryStream对象”并使用stream.CopyTo()分配,使用“memorystream object”返回byte [] .ToArray()

如果您不想更改上述代码,请执行以下操作 1.检查“stream.Length”的值 2.添加一些填充(附加),例如byte [] buffer = new byte [stream.Length + 10] 3.另外,检查是否可以使用.CanRead()

读取流