public void fileOutputStream() throws IOException{
String temp="Hello world!\n";
FileOutputStream fos = new FileOutputStream("D:\\my.txt",true);//true表示在文件末尾追加
fos.write(temp.getBytes());
fos.close();//流要及时关闭
}
黑色头发:http://heisetoufa.iteye.com/