[Project_owners] Re: Converting Strings to Char Arrays in Javascript

WC Leung lwchk2001 at yahoo.com.hk
Tue Aug 2 01:12:01 EDT 2005


I also speculate that using nsIBinaryInputStream interface on a
nsIStringInputStream will do the conversion quickly. No motivation to
test though.

WC Leung wrote:
> Well, I found that I can simply put it into a nsIStringStream:
> 
> var ss =
> Components.classes["@mozilla.org/io/string-input-stream;1"].getService(Components.interfaces.nsIStringInputStream);
> ss.setData(aResult, aResult.length);
> var dp = new DOMParser;
> var doc = dp.parseFromStream(ss, null, aResult.length, "text/xml");
> 
> Since XPCOM is allowed this solution is okay for me.


More information about the Project_owners mailing list