As far as I know, there is two main ways for converting a string into MemoryStream.
string
MemoryStream.
MemoryStream ms = new MemoryStream(Encoding.UTF8