public static void writeTxtFile(String savePath) throws IOException//保存文件
{
String content = "一次性保存所有内容";
File fileName = new File(savePath);
FileOutputStream o=null;
if(!fileName.exists())
{ //若文件名不存在,则创建文件
fileName.createNewFile();
}
o=new FileOutputStream(fileName);
o.write(content.getBytes("GBK"));
o.close();
System.out.println("文件保存为"+savePath);
}