参见下面的代码:
File f = new File("hello.txt");
try
{
FileWriter out = new FileWriter(f);
String buf = "goodplay";
out.write(buf,f.length());
out.close();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
这里每次调用out.write的时候就把文件原来的内容覆盖了,这不是我所期望的结果,有没有好的解决方法?