通過NSInputStream讀取大檔案的指定起始內容

modun1986發表於2011-05-24

轉載自:http://www.cocoachina.com/bbs/read.php?tid-60598.html

 

NSFileHandle *fileHandle = [NSFileHandle fileHandleForReadingAtPath:filePath];
[fileHandle seekToFileOffset:1000];
NSData *data = [fileHandle readDataOfLength:2000];
 

相關文章