重定向写入一个文件到流C#重定向、文件

2023-09-03 23:27:40 作者:墨羽

我想问问,如果有可能写入重定向到一个特定的文件,在我的应用程序内存流这样我就可以立即读取它。 如果可能的话,请解释如何做到这一点。

I wanted to ask if it is possible to redirect writes to a specific file, to a memory stream in my application so I can immediately read it. If it is possible please explain how to do so.

感谢。

推荐答案

请确保您的应用程序使用,然后你可以使用 MemoryStream的具体实施来实现流媒体没有的文件。

Make sure your application works with Stream, and then you can use the MemoryStream concrete implementation to accomplish streaming without a file.