Convert String to System.IO.Stream


str string  = 'some string';
// Convert String to System.IO.Stream
System.Byte[]           byteArray   = System.Text.Encoding::get_UTF8().GetBytes(string);
//System.Byte[]           byteArray   = System.Text.Encoding::get_ASCII().GetBytes(string);
System.IO.MemoryStream  stream      = new System.IO.MemoryStream(byteArray);

// Convert Byte array to String
string = System.Text.Encoding::get_UTF8().GetString(byteArray);
//string = System.Text.Encoding::get_ASCII().GetString(byteArray);


 

Search

About

DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own AdSense units.
Join us.

Blog Tags