• 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: Cocoa equivalent to fputc()?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa equivalent to fputc()?


  • Subject: Re: Cocoa equivalent to fputc()?
  • From: John Stiles <email@hidden>
  • Date: Tue, 05 Sep 2006 07:40:28 -0700

I think the moral equivalent of fputc would be

char c = whatever;
[myMutableData appendBytes:&c length:sizeof(char)];

Doesn't seem all that fussy to me.
I don't know if it will be /efficient/ though. I don't know if NSMutableData is optimized for appending data one byte at a time. (I guess you could check out the CFData source :) )



Chris Ryan wrote:
Looking at NSMutableData's appendBytes:length: method, which seems a little fussy in terms of creating buffers etc. [1]. Am I looking in the wrong place? Is there a better/easier class or way to work with a mutable data object?

[1] http://developer.apple.com/documentation/Cocoa/Conceptual/BinaryData/Tasks/WorkingMutableData.html



Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cocoa equivalent to fputc()?
      • From: John Stiles <email@hidden>
References: 
 >Cocoa equivalent to fputc()? (From: Chris Ryan <email@hidden>)

  • Prev by Date: Stream programming: premature 'end encountered' event
  • Next by Date: Re: Cocoa equivalent to fputc()?
  • Previous by thread: Re: Cocoa equivalent to fputc()?
  • Next by thread: Re: Cocoa equivalent to fputc()?
  • Index(es):
    • Date
    • Thread