Re: Partially release NSMutableData
Re: Partially release NSMutableData
- Subject: Re: Partially release NSMutableData
- From: Graham Cox <email@hidden>
- Date: Thu, 5 Aug 2010 17:59:59 +1000
On 04/08/2010, at 11:02 PM, Marcus Karlsson wrote:
> 3. Use a single NSMutableData object. Once enough data has arrived move the data that may have been appended later to the beginning and adjust the capacity.
>
> Any opinions on which one to use or ideas on even better ones?
This one's easiest. Use -replaceBytesInRange:withBytes:length:
This works if the replacement bytes are nil, so acting to delete a range of bytes. The range would be from 0 to however much you've processed so far.
--Graham
_______________________________________________
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