NSInputStream getBuffer:length:
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.