c# - How to get System.IO.Stream from a String Object -



c# - How to get System.IO.Stream from a String Object -

i have string object. need pass info object of type xyz. object of type xyz taking system.io.stream. how convert string info stream object of xyz type can utilize string data?

you'll have pick text encoding utilize translate string byte array, utilize memorystream phone call function. example:

using(system.io.memorystream ms = new system.io.memorystream( system.text.encoding.utf16.getbytes(yourstring))) { xyz(ms); }

you can alter utf16 whatever encoding you'd utilize pass string.

c# string

Comments

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -