Q:

NSData & NSMutabledata. How do I read from within the body of a data object?

I have a lllooonnnggg NSMutableData instance. I want to feed non-overlapping sub-ranges this data to other objects. I've perused the NSData/NSMutableData docs and don't quite have a grasp of the proper way to do this.
So for example the NSMutableData replaceBytesInRange:withBytes: looks ideal but I need the withBytes: parameter to point to a location beyond the head of the byte stream returned by  [mySourceHumungousData bytes].
I can get hack-ish and drop into pure C and do this but I'd prefer not to do that.
Cheers,
Doug

A:

Try subdataWithRange: on an NSData instance.  That should let you slice up your data however you want it before you go to replace the desired bytes in your NSMutableData.

