• 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
NSInputStream getBuffer:length:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSInputStream getBuffer:length:


  • Subject: NSInputStream getBuffer:length:
  • From: Joannou Ng <email@hidden>
  • Date: Sat, 6 Mar 2004 00:59:00 -0500

Hi all,

Anyone got NSInputStream's getBuffer:length: to work with sockets? Following is a method defined in my category of NSInputStream:

- (NSString *)readString
{
uint8_t *buffer;
unsigned int bufferLength;

if ([self getBuffer:&buffer length:&bufferLength]) {
return [[[NSString alloc] initWithBytes:buffer length:bufferLength encoding:NSUTF8StringEncoding] autorelease];
} else {
return [NSString string];
}
}

getBuffer:length: never returns YES. Should I just go back to using read:maxLength: ?

Cheers, Joannou.

Evolution is hampered by compassion. - Joannou Ng
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: NSInputStream getBuffer:length:
      • From: p3consulting <email@hidden>
  • Prev by Date: Re: Delegate methods not working...
  • Next by Date: Re: Addressbook style textfield
  • Previous by thread: Re: Delegate methods not working...
  • Next by thread: Re: NSInputStream getBuffer:length:
  • Index(es):
    • Date
    • Thread