title: How to signal an NSStreamEventEndEncountered on an NSInputStream reading from NSMutableData
body: <p>In Cocoa, I've setup two NSThreads, one producer and one consumer.
  The producer appends data to an NSMutableData, and the receiver opens an NSInputStream from that data and reads in chunks.</p>
  
  <p>The producer thread writes a lot faster than the consumer processes, which is OK. But the producer only produces a finite amount of work, then exits. I'd like for the consumer thread to handle the NSStreamEventEndEncountered event. How can I signal this when the NSInputStream comes from an NSMutableData?</p>
  
  <p>Should I just make the producer send a series of bytes with a magical number signifying an end of stream?</p>