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

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -