如何做流CanSeek真的? [英] How to do stream CanSeek in true?

查看:153
本文介绍了如何做流CanSeek真的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过使用HttpWebRequest / HttpWebResponse得到了流。这些流没有长度,标志CanSeek设置为false。我怎样才能使这些流'CanSeek真实?

我知道,我需要在隔离存储中保存流,然后从存储中获取流。但我不喜欢使用这个解决方案。有人知道另一种方式吗? 

I got stream by using HttpWebRequest/HttpWebResponse. These stream don't have length and flag CanSeek set in false. How can I make these stream' CanSeek in true?
I khow, that I need save stream in Isolated Storage and after that get stream from storage. But I'd not  like to use this solution. Does anybody know another way? 

推荐答案

你无法让蒸汽寻求能力。您需要全部读取并将字节保存到文件或内存流中。然后,您可以在文件流或内存流中进行搜索。
You can't make that steam seek able. You need to read it all and save the bytes to a file or a memory stream. Then you can seek in a file stream or in the memory stream.


这篇关于如何做流CanSeek真的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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