using System;using System.IO;using System.Text; namespace streamDemo{class Program{static void Main( string[] args ){string str= "I love my India"; /*convert string to stream*/byte[] byteArray = Encoding.ASCII.GetBytes( str);MemoryStream stream = new MemoryStream( byteArray ); /* convert stream to string*/StreamReader reader = new StreamReader( stream );string text = reader.ReadToEnd(); Console.WriteLine(str);Console.ReadLine();}}}
Hari BPosted Nov 3, 2015, 7:02 AM
Encoding get from where??
Dinkar ChavhanPosted Apr 20, 2011, 8:19 AM
nice
Mayur GujrathiPosted Apr 20, 2011, 6:49 AM
I think this is usually done in converting image am i right Ankit?