从流转换为内存流 [英] Convert from stream to memory stream

查看:62
本文介绍了从流转换为内存流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了Windows Phone 8应用程序,并且想要将流转换为memorystream.我的代码是这样的;

I develop a Windows Phone 8 application and I want to convert stream to memorystream. My code is like this;

但是exampleForMemStream的容量,长度和位置始终为0.我该怎么办?

But exampleForMemStream's capacity,length and position is always 0 . What can i do?

推荐答案

一个问题是,在您的情况下,这些步骤需要按顺序进行,因此您需要在CopyTo前面加上await运算符:

One issue is that in your case the steps need to occur in serial order, so you need to prefix the CopyTo with the await operator:

-马克


这篇关于从流转换为内存流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆