I have an input stream and I want to start reading bytes at a certain location. Is there any way I can do that? Say I want to read 1024
bytes at location n
, n
being the nth
byte in the file. How do I achieve this? I've looked at the documentation and there doesn't appear to be way to do this.
Asked
Active
Viewed 185 times
0
1 Answers
0
You need to use the below api for reading :-
+ (id)inputStreamWithFileAtPath:(NSString *)path
- (NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)len;

Hussain Shabbir
- 14,801
- 5
- 40
- 56
-
Doesn't `read:maxlength:` read from the beginning of the file into the buffer? – Milo Jul 06 '14 at 12:01