it
NSData *data = [NSData dataWithContentsOfMappedFile:<path>];
NSRange first4k = {0, MIN([data length], 4096)};
return [data subdataWithRange:first4k];
gives you only the first 4k file without downloading it.
But dataWithContentsOfMappedFile: is deprecated in iOS5.
I suppose - WARNING: untested! -
+ (id)dataWithContentsOfURL:(NSURL *)aURL options:(NSDataReadingOptions)mask error:(NSError **)errorPtr
with a mask mounted on
NSDataReadingMappedIfSafe
NSDataReadingMappedAlways
.
iOS5.