Code example for OutputStreamWriter

Methods: close

0
        NodeModel rootNode = NodeModel.parse(inputFile);
        OutputStream outputStream = System.out;
        if (outputFile != null) {
            outputStream = new FileOutputStream(outputFile);
        } 
        Writer outputWriter = new OutputStreamWriter(outputStream, encoding);
        try { 
            template.process(null, outputWriter, null, rootNode);
        } finally { 
            if (outputFile != null)
                outputWriter.close();
        } 
    } 
     
    static Transform transformFromArgs(String[] args) throws IOException {
        int i=0;
        String input = null, output=null, ftl = null, loc = null, enc = null; 
        while (i<args.length) {
            String dashArg = args[i++];
            if (i>=args.length) {
                throw new IllegalArgumentException("");