I'm writing a service to get VARBINARY information from a Vendor's service and insert it in to a database on my network. In the example below oResponseObject is declared as an Object, ExecuteURL is an Object, but is returned as System.IO.MemoryStream.
strURL += APIHelper.GetQueryStringParameter("image_id", reader["ImageID"].ToString());
Object oResponseObject = ExecuteURL(strURL, true);
byte[] bytes = ???
QUESTION: How do I convert that MemoryStream so that it will work with the byte[]? I've already tried Encoding.ASCII.GetBytes and Encoding.UTF8.GetBytes. It will go to the Array and insert in to the database with no problem. When I try to render the graphic I get an error indicating that it's either too big or the file is corrupt.