iOS NSFileHandle详解
来源:互联网 发布:plc与单片机应用场合 编辑:程序博客网 时间:2024/04/30 07:41
常用处理方法
@property (readonly, copy) NSData *availableData;//从设备或通道返回可用的数据
- (NSData *)readDataToEndOfFile; 从当前的节点读取到文件的末尾
- (NSData *)readDataOfLength:(NSUInteger)length; 从当前节点开始读取指定的长度数据
- (void)writeData:(NSData *)data; 写入数据
- (unsigned longlong)offsetInFile; 获取当前文件的偏移量
- (unsigned longlong)seekToEndOfFile; 跳到文件末尾
- (void)seekToFileOffset:(unsignedlonglong)offset; 跳到指定文件的偏移量
- (void)truncateFileAtOffset:(unsignedlong long)offset; 将文件的长度设为offset字节
- (void)synchronizeFile;//同步
- (void)closeFile; 关闭文件
+ (id)fileHandleForReadingAtPath:(NSString*)path 打开一个文件准备读取
+ (id)fileHandleForWritingAtPath:(NSString *)path 打开一个文件准备写入
+ (id)fileHandleForUpdatingAtPath:(NSString *)path 打开一个文件准备更新
- (instancetype)initWithFileDescriptor:(int)fd;//初始化文件处理对象
@property (readonly) int fileDescriptor;//文件描述符
//异步通信、、高级使用方法移步另一篇博客
- (void)readInBackgroundAndNotifyForModes:(nullable NSArray<NSRunLoopMode> *)modes;
- (void)readInBackgroundAndNotify;
- (void)readToEndOfFileInBackgroundAndNotifyForModes:(nullable NSArray<NSRunLoopMode> *)modes;
- (void)readToEndOfFileInBackgroundAndNotify;
- (void)acceptConnectionInBackgroundAndNotifyForModes:(nullable NSArray<NSRunLoopMode> *)modes;
- (void)acceptConnectionInBackgroundAndNotify;
- (void)waitForDataInBackgroundAndNotifyForModes:(nullable NSArray<NSRunLoopMode> *)modes;
- (void)waitForDataInBackgroundAndNotify;
======================================================================
//NSFileHandle读取
//NSFileHandle追加 和 定位
//NSFileHandle复制
//NSFileHandle合并数据
//NSFileHandle文件指针的使用
- iOS NSFileHandle详解
- iOS疯狂详解之NSFileHandle
- iOS NSFileHandle使用
- iOS基础一 NSFileHandle
- ios文件存储--NSFileHandle
- IOS NSFileHandle 基本用法
- ios开发之NSFileHandle
- iOS NSFileHandle的使用
- ios-NSFileHandle和NSOutputStream
- iOS: NSFileHandle的方法fileHandleForReadingAtPath:
- iOS: NSFileHandle的方法fileHandleForUpdatingAtPath:
- iOS: NSFileHandle的方法fileHandleForWritingAtPath:
- iOS: NSFileHandle的方法fileHandleWithStandardInput
- iOS: NSFileHandle的方法fileHandleWithStandardOutput
- iOS: NSFileHandle的方法availableData
- iOS: NSFileHandle的方法closeFile
- iOS: NSFileHandle的方法fileDescriptor
- iOS: NSFileHandle的方法initWithFileDescriptor:
- fzu 2082 过路费(树链剖分,单点更新+区间求和)
- C#中对byte类型的处理还是很特殊的。
- POJ2389 FFT 大数乘法
- Mysql 常用函数总结(其他函数)
- 微信公众号【客服接口】
- iOS NSFileHandle详解
- 简单理解struts中的ValueStack(VS)+实例
- OkHttp基本使用方式
- 临时保存文件
- 杭电 2068 ( RPG的错排 ) 排列组合+错排
- IP 地址和 Int 型之间的转换
- hibernate的执行流程
- 部分的缩写规范
- android-studio如何获取调试版和正式版sha1值