本帖最后由 awkflf11 于 2014-3-25 18:14 编辑
public static void writeFile() throws IOException{
// FileWriter fw = new FileWriter("temp\\default.txt");
// fw.write("你好");
// fw.close();
FileOutputStream fos = new FileOutputStream("temp\\trans_default.txt");
// OutputStreamWriter osw = new OutputStreamWriter(fos);
// osw.write("你好");
// osw.close();
FileOutputStream fos = new FileOutputStream("temp\\trans_GBK.txt");
OutputStreamWriter osw = new OutputStreamWriter(fos,"GBK");
osw.write("你好");
osw.close();
}
这三种,,方式那个正确??如果在开发中,我们用那个那?? 谢谢。。
|