Cybercrux

Everything is achievable through technology

Stream to byte convert

 

var request = (HttpWebRequest)WebRequest.Create(address);

var webResponse = request.GetResponse();

byte[] outputBytes;
using (var memoryStream = new MemoryStream())
{
webResponse.GetResponseStream().CopyTo(memoryStream);
outputBytes = new byte[memoryStream.ToArray().Length];
outputBytes = memoryStream.ToArray();
}