Like in the topic: I want to read data from a file (from stream) into memory (memorystream) to improve my app speed. How to do it?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
If you can hold the entire file in memory, File.ReadAllBytes should work for you:
A few options:
Read it all into a byte array first...
Or use .NET 4's CopyTo method
Or do it manually