OutputStream写文件后异常关机,文件写入失败

FileOutputStream fos = null;
 File file = new File("/efs/param.txt");
 fos = new FileOutputStream(file);
fos.write(info.getBytes("UTF-8"));
fos.flush();
fos.getFD().sync();                       
                                  

fos.getFD().sync() 同步缓冲区数据

你可能感兴趣的:(OutputStream写文件后异常关机,文件写入失败)