如何用FileOutputStream写数据而不丢失旧数据?
如果使用FileOutputStream方法,则每次通过这种方法编写文件时,都会丢失旧数据。 是否有可能通过FileOutputStream写入文件而不会丢失旧数据? 
 使用带有File和boolean的构造函数 
 FileOutputStream(File file, boolean append) 
 并将布尔值设置为true 。 这样,您所写的数据将被附加到文件的末尾,而不是覆盖已经存在的内容。 
使用构造函数将材料附加到文件中:
 FileOutputStream(File file, boolean append) Creates a file output stream to write to the file represented by the specified File object. 
所以追加到一个文件说“abc.txt”使用
 FileOutputStream fos=new FileOutputStream(new File("abc.txt"),true);