Convert Stream To Byte Array

Niladri.Biswas
Posted by Niladri.Biswas under C# category on | Points: 40 | Views : 15986
The below code snippet will help to convert a Stream to BytArray

private byte[] ToByteArray(Stream inputStream)
{
using (MemoryStream ms = new MemoryStream())
{
inputStream.CopyTo(ms);
return ms.ToArray();
}
}

Comments or Responses

Login to post response