@@ -141,10 +141,34 @@ while (readLength < length) readLength += [self readIntoBuffer: (char*)buffer + readLength length: length - readLength]; } + +- (void)asyncReadIntoBuffer: (void*)buffer + length: (size_t)length + target: (id)target + selector: (SEL)selector +{ + [OFRunLoop OF_addAsyncReadForStream: self + buffer: buffer + length: length + target: target + selector: selector]; +} + +- (void)asyncReadIntoBuffer: (void*)buffer + exactLength: (size_t)length + target: (id)target + selector: (SEL)selector +{ + [OFRunLoop OF_addAsyncReadForStream: self + buffer: buffer + exactLength: length + target: target + selector: selector]; +} #ifdef OF_HAVE_BLOCKS - (void)asyncReadIntoBuffer: (void*)buffer length: (size_t)length block: (of_stream_async_read_block_t)block @@ -693,10 +717,28 @@ if ([self isAtEndOfStream]) return nil; return line; } + +- (void)asyncReadLineWithTarget: (id)target + selector: (SEL)selector +{ + return [self asyncReadLineWithEncoding: OF_STRING_ENCODING_UTF_8 + target: target + selector: selector]; +} + +- (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding + target: (id)target + selector: (SEL)selector +{ + [OFRunLoop OF_addAsyncReadLineForStream: self + encoding: encoding + target: target + selector: selector]; +} #ifdef OF_HAVE_BLOCKS - (void)asyncReadLineWithBlock: (of_stream_async_read_line_block_t)block { return [self asyncReadLineWithEncoding: OF_STRING_ENCODING_UTF_8