wflo...@googlemail.com
unread,Apr 10, 2013, 12:57:48 AM4/10/13You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
At the moment I'm using the AstRoot.toSource() method to generate my javascript files. But this is really slow for large js files on mobile devices (less memory), because toSource() is using a StringBuilder which holds the complete file. Is there a way to directly stream the js-code to an output file?
Example:
System.out.println("parsing js file: " + scriptUri);
Parser jsParser = new Parser();
AstRoot ast = jsParser.parse(inputStreamReader, scriptUri, 0);
System.out.println("manipulate js file: " + scriptUri);
ast.visit(new DebugInstrumentator());
System.out.println("writing js file: " + scriptUri);
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outputStream));
writer.write(ast.toSource());
writer.close();
regards,
-cyberflohr