Re: Efficiently receiving data from an NSTask
Re: Efficiently receiving data from an NSTask
- Subject: Re: Efficiently receiving data from an NSTask
- From: Charles Srstka <email@hidden>
- Date: Mon, 7 Jul 2008 10:52:06 -0500
On Jul 7, 2008, at 10:16 AM, Michael Ash wrote:
3) Look for a clean break in the UTF-8 sequence. This is not as
difficult as it sounds. There are two easy scenarios where you can
break. The first is after any ASCII character. You can scan your
NSMutableData buffer for any char value <= 127, and break at that
location. Second, you can break *before* any char value that matches
this mask:
c & 0xA == 0xA
This will find a char whose first two bits are both 1.
Um, no it won't. The mask for the first two bits would be 0xC0, not
0xA. 0xA would be 0101, which other than being the ASCII newline
character, doesn't seem terribly interesting for this use.
Charles
_______________________________________________
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