ToMemoryStream

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();

Description

Returns a MemoryStream from a Byte array

Details

Double click on the code to select all.

 

;