• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Efficiently receiving data from an NSTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Efficiently receiving data from an NSTask
      • From: "Michael Ash" <email@hidden>
References: 
 >Efficiently receiving data from an NSTask (From: "Martin Hairer" <email@hidden>)
 >Re: Efficiently receiving data from an NSTask (From: Omar Qazi <email@hidden>)
 >Re: Efficiently receiving data from an NSTask (From: Andrew Farmer <email@hidden>)
 >Re: Efficiently receiving data from an NSTask (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: NSURLConnection how to handle 502 error
  • Next by Date: Re: Toolbar code in separate Controller?
  • Previous by thread: Re: Efficiently receiving data from an NSTask
  • Next by thread: Re: Efficiently receiving data from an NSTask
  • Index(es):
    • Date
    • Thread