Code example for OutputStreamWriter

Methods: closeappend

0
     */ 
    public static boolean writeFile(String outfile, String data) {
        boolean status = false;
        OutputStreamWriter out = null;
        try { 
            out = new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8");
            out.append(data);
            status = true;
        } catch (IOException ex) {
            Log.error(ex.getMessage());
        } finally { 
            try { 
                if (out != null) {
                    out.close();
                } 
            } catch (IOException ex) {
            } 
        } 
        return status;
    } 
Stop searching for code, let great code find you!  Add Codota to your java IDE