/// <summary>
/// Convert to memory stream
/// </summary>
/// <param name="stream"></param>
/// <returns></returns>
public static byte[] ReadStream(Stream stream)
{
using (var ms = new MemoryStream())
{
stream.CopyTo(ms);
return ms.ToArray();
}
}