Re: [NSMutableData resetDataRangeTo:(NSRange)range];
Re: [NSMutableData resetDataRangeTo:(NSRange)range];
- Subject: Re: [NSMutableData resetDataRangeTo:(NSRange)range];
- From: Carl Hoefs <email@hidden>
- Date: Mon, 14 Jul 2014 12:15:04 -0700
On Jul 14, 2014, at 11:54 AM, Jens Alfke <email@hidden> wrote:
>
> On Jul 14, 2014, at 11:48 AM, Carl Hoefs <email@hidden> wrote:
>
>> Yes, I guess it's the semantics that threw me. I was attempting to "insertBytesInRange" not "replaceBytesInRange", so I had it in my mind that the one couldn't do the other. But that's the whole purpose of the NSRange. Very cool.
>
> The equivalent function in the ‘classic’ Mac OS had the very appropriate name of Munger( ) since it would munge bytes around in a heap block. Knowing how to use Munger was a sign of geek cred in the old (80s-90s) Mac dev community.
>
> ( http://www.mactech.com/articles/mactech/Vol.12/12.05/Handles2/index.html )
>
> —Jens
Okay, 1 last question on this. Is there a way to promote-in-place an NSData object into an NSMutableData object? -becomeMutable or some such? I'm trying to avoid copying megabytes of data/sec if it's avoidable.
-Carl
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden