ToMemoryStream
Returns a MemoryStream from a Byte array
Source
public static MemoryStream ToMemoryStream(this Byte[] buffer)
{
MemoryStream ms = new MemoryStream(buffer);
ms.Position = 0;
return ms;
}
Example
MemoryStream ms = File.ReadAllBytes(@"c:\test.txt").ToMemoryStream();