1. I use MemoryStream unless I plan to save the file to the disk then go with FileStream. However, if you are going from stream to bytes MemoryStream is very helpful
2. I've completed an application that needed this an I didnt notice any speed reduction
/// <summary>
/// Reads a Stream and outputs and return a byte array byte[]
/// </summary>
/// <param name="input"> Stream </param>
/// <returns> byte[] </returns>
public static byte[] ReadFully(Stream input)
{
using (var ms = new MemoryStream())
{
input.CopyTo(ms);
return ms.ToArray();
}
}
This is the best soltion I found for my project after scouring the web for stream to byte array. 3 lines
An array is already split so how do you want it "split", give me some detail