Creating a byte array from a stream
- by Bob
What is the preffered method for creating a byte array from an input stream?
Here is my current solution with .NET 3.5.
Is it still a better idea to read and write chunks of the stream?
Stream s;
byte[] b;
using (BinaryReader br = new BinaryReader(s)) {
b = br.ReadBytes(s.Length);
}