if (!file.exists()) {
file.createNewFile();
}
FileOutputStream fos = new FileOutputStream(filePath+filename, flag);
OutputStreamWriter osw = new OutputStreamWriter(fos, "utf-8");
for (String temp : fileContent)
osw.write(temp + "\r\n");
osw.flush();
osw.close();
}
--------------------------------------分割线 --------------------------------------
编写高质量代码 改善Java程序的151个建议 PDF高清完整版
Java对象序列化ObjectOutputStream和ObjectInputStream示例
--------------------------------------分割线 --------------------------------------