How to convert Text into Stream?

Poster
Posted by Poster under C# category on | Views : 3198
Use System.IO namespace and write following code.


ASCIIEncoding encoding = new ASCIIEncoding();
byte[] requestData = encoding.GetBytes(dataToInstruct);
MemoryStream memoryStream = new MemoryStream(requestData);
Stream stream = (Stream) memoryStream;

Comments or Responses

Login to post response