Viraj_Kanwade
asked on
need help converting stream to byte array.
Stream ReceiveStream = myWebResponse.GetResponseS tream();
i am using this stream and need to convert it to a byte array. i have to pass the byte array to another function ao i need the stream converted whole to byte array and the size of data received in stream is variable.
so can any1 please give me a code to convert this.
i am using this stream and need to convert it to a byte array. i have to pass the byte array to another function ao i need the stream converted whole to byte array and the size of data received in stream is variable.
so can any1 please give me a code to convert this.
ASKER
MemoryStream ReceiveStream = (MemoryStream)myWebRespons e.GetRespo nseStream( );
on this i get a >> specified cast is not valid << exception
is there any other way or some changes needed to the above code
on this i get a >> specified cast is not valid << exception
is there any other way or some changes needed to the above code
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Byte [] bytes = ReceiveStream.ToArray();