android in practice_Making sure files are saved with sync
来源:互联网 发布:淘宝crm系统架构 编辑:程序博客网 时间:2024/06/05 12:22
You need to guarantee that file data is written to disk immediately, regardless of the filesystem in use and the platform version.
Syncing ensures that the buffer catches up with the physical disk.
You can get a FileDescriptor reference from FileOutputStream, and then sync, as shown in the next listing.
public static boolean syncStream(FileOutputStream fos) {try {if (fos != null) {try {fos.getFD().sync();} catch (IOException e) {Log.e(Constants.LOG_TAG,"Error syncing fos " + e.getMessage(), e);}return true;}return false;}
- android in practice_Making sure files are saved with sync
- Android Studio “Sync project with Gradle Files”按钮消失问题
- Android Studio里面的sync project with gradle files
- android in practice_Making remote procedure calls(GoodShares project)
- Make sure Drupal file types are recognized as PHP files
- config servers are not in sync【mongo】
- Android display local image/CSS files in HTML with WebView
- Generate mp4 video with image files using Jcodec in Android
- Generate mp4 video with image files using MediaCodec in Android
- Working with Files in C#
- Working-with-files-in-javascript
- How to Upload Multiple files in one request along with other string parameters in android?
- Zipping Files with Android (Programmatically)
- android-sharing files with NFC
- Working with CSV files in Bash
- Working with Excel Files in Python
- One or more files are in a conflicted state
- Why are .goutputstream-xxxxx files created in home folder?
- Linux下使用Tuxedo的例子
- Linux进程状态与实时操作系统进程状态区别
- 如何查看sql server数据库连接数
- c++ 字符串反转方法 UNICODE 和 ANSI 版本
- 惯性导航系统
- android in practice_Making sure files are saved with sync
- 二叉树的遍历与建立
- 【VBA研究】利用ADO让普通人用excel读取oracle数据库表的通用办法
- 设计模式之访问者模式(visitor)
- 你比六年级的小学生聪明吗?—— Java数组的初始化
- Javascript笔记
- sql 上一条、下一条记录再次改进(文章底部红色字体)及如何在子查询中使用limit语法!我这个脑子啊
- 献给正在郁闷的人
- 距离保护中的几个重要概念