P pixelpop Active Member Licensed User Longtime User Jan 30, 2013 #1 Is there a method for converting a String to an InputStream? I use HttpUtils2 to retrieve an XML file, but I need to edit it before I process it with XMLSax. So I'm thinking that I should use GetString to get the XML data, edit it, then convert the edited string to an inputstream before sending it to the XMLSax process. Thanks!
Is there a method for converting a String to an InputStream? I use HttpUtils2 to retrieve an XML file, but I need to edit it before I process it with XMLSax. So I'm thinking that I should use GetString to get the XML data, edit it, then convert the edited string to an inputstream before sending it to the XMLSax process. Thanks!
Erel B4X founder Staff member Licensed User Longtime User Jan 30, 2013 #2 Here: Code: Copy Sub StringToInputStream (s As String) As InputStream Dim In As InputStream Dim data() As Byte = s.GetBytes("UTF8") In.InitializeFromBytesArray(data, 0, data.Length) Return In End Sub Upvote 0
Here: Code: Copy Sub StringToInputStream (s As String) As InputStream Dim In As InputStream Dim data() As Byte = s.GetBytes("UTF8") In.InitializeFromBytesArray(data, 0, data.Length) Return In End Sub