Here you can find the source of writefile(String path, String content)
public void writefile(String path, String content) throws IOException
//package com.java2s; /* Copyright 2012, UCAR/Unidata. See the LICENSE file for more information. *//*from w w w . jav a 2s .co m*/ import java.io.*; public class Main { public void writefile(String path, String content) throws IOException { FileWriter out = new FileWriter(path); out.write(content); out.close(); } static public void writefile(String path, byte[] content) throws IOException { FileOutputStream out = new FileOutputStream(path); out.write(content); out.close(); } }