I have a JSON string in a MemoryStream. I am using the following code to get it out as an ASCII string:
MemoryStream memstream = new MemoryStream(); /* Write a
You could use the ToArray method:
using (var stream = new MemoryStream()) { /* Write a JSON string to stream here */ string jsonString = Encoding.ASCII.GetString(stream.ToArray()); }
new StreamReader(memstream, Encoding.ASCII).ReadToEnd()