java fsync同步到磁盘
FileOutputStream fos = new FileOutputStream(entryFile);
BufferedOutputStream dest = new BufferedOutputStream(fos, BUFFER);
// Write to new file.
while ((count = zis.read(data, 0, BUFFER)) != -1)
{
dest.write(data, 0, count);
}
dest.flush();
// 关键是下面这句,强制将数据写入磁盘
FileDescriptor fd = fos.getFD();
fd.sync();
---------------------
作者:T-Quake
来源:CSDN
原文:https://blog.csdn.net/helldevil/article/details/8063790
版权声明:本文为博主原创文章,转载请附上博文链接!