Convert a String to a Stream
Programming June 29th, 2010
In C#, to convert a String into a Stream object, we need to use the GetBytes method (from the Encoding.ASCII package), this way:
byte[] bytes = Encoding.ASCII.GetBytes(xmlContent);
And then, use that byte array when instantiate a Stream (for example, MemoryStream or FileStream):
MemoryStream stream = new MemoryStream(bytes);
About