-1

I implemented NSInputStream subclass like following:

ClassName: SampleInputStream

-(id)init{

self = [super init];

if (self) {

}
return self;
}

- (NSInteger)read:(const uint8_t *)buffer
      maxLength:(NSUInteger)length{

   return 0;
}

- (BOOL)getBuffer:(uint8_t **)buffer length:(NSUInteger *)len{

   return YES;

}

After that I am calling this class from other class like this

SampleInputStream *obj = [[SampleInputStream alloc] init];

But the read method and getBuffer method are not calling.

Could you please suggest.

iOS
  • 811
  • 1
  • 6
  • 8

1 Answers1

0

Go read documentation and samples. You don't understand what streams are for.

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Streams.html#//apple_ref/doc/uid/10000188i

pronebird
  • 12,068
  • 5
  • 54
  • 82