android关于RandomAccessFile
2016-05-10 22:41
501 查看
RandomAccessFile类
/**
* Allows reading from and writing to a file in a random-access manner. This is
* different from the uni-directional sequential access that a
* {@link FileInputStream} or {@link FileOutputStream} provides. If the file is
* opened in read/write mode, write operations are available as well. The
* position of the next read or write operation can be moved forwards and
* backwards after every operation.
*/
/**
* Constructs a new {@code RandomAccessFile} based on the file named {@code
* fileName} and opens it according to the access string in {@code mode}.
* The file path may be specified absolutely or relative to the system
* property {@code "user.dir"}.
*
* @param fileName
* the name of the file to open.
* @param mode
* the file access <a href="#accessmode">mode</a>, either {@code
* "r"}, {@code "rw"}, {@code "rws"} or {@code "rwd"}.
* @throws FileNotFoundException
* if the file cannot be opened or created according to {@code
* mode}.
* @throws IllegalArgumentException
* if {@code mode} is not {@code "r"}, {@code "rw"}, {@code
* "rws"} or {@code "rwd"}.
*/
public RandomAccessFile(String fileName, String mode) throws FileNotFoundException {
this(new File(fileName), mode);
}
/**
* Allows reading from and writing to a file in a random-access manner. This is
* different from the uni-directional sequential access that a
* {@link FileInputStream} or {@link FileOutputStream} provides. If the file is
* opened in read/write mode, write operations are available as well. The
* position of the next read or write operation can be moved forwards and
* backwards after every operation.
*/
/**
* Constructs a new {@code RandomAccessFile} based on the file named {@code
* fileName} and opens it according to the access string in {@code mode}.
* The file path may be specified absolutely or relative to the system
* property {@code "user.dir"}.
*
* @param fileName
* the name of the file to open.
* @param mode
* the file access <a href="#accessmode">mode</a>, either {@code
* "r"}, {@code "rw"}, {@code "rws"} or {@code "rwd"}.
* @throws FileNotFoundException
* if the file cannot be opened or created according to {@code
* mode}.
* @throws IllegalArgumentException
* if {@code mode} is not {@code "r"}, {@code "rw"}, {@code
* "rws"} or {@code "rwd"}.
*/
public RandomAccessFile(String fileName, String mode) throws FileNotFoundException {
this(new File(fileName), mode);
}
相关文章推荐
- Android JSON原生解析的几种思路,以号码归属地,笑话大全,天气预报为例演示
- Android JSON原生解析的几种思路,以号码归属地,笑话大全,天气预报为例演示
- android关于getLayoutParams()方法源码译文(部分)
- Android中的Activity
- js与android代码的交互
- Android NDK日志输出
- Android Studio报错@integer/google_play_services_version').
- java Android SDK安装与环境变量配置以及开发第一个Android程序
- Android入门学习——Retrofit+MVP模式学习
- android选取本地图片及关于图片压缩上传问题
- 五步搞定Android开发环境部署——非常详细的Android开发环境搭建教程
- android 屏幕适配
- ubuntu kylin 14.04 下载,编译,安装android内核源码
- android中获取文件的md5值时首位出现0被省略,而造成了只有31位字符的解决办法。
- Android基础知识:广播
- Android开发工具之Android Studio----版本控制SVN使用(一)
- android.support.v7.widget.Toolbar 中menu图标不显示问题
- Android View系列一: View基础知识
- Android中的通知 Notification
- Android的Handler,Looper消息机制问题