My question is where can I add code like "sendStream = ..."?
You're already assigning sendStream
with the getStreamsToHost:port:inputStream:outputStream:
message. That method returns the two streams by reference.
… how to convert the imageData to NSOutputStream's instance?
You don't need to convert the data to a stream, you need to tell a stream to write the data.
Try NSOutputStream's write:maxLength:
method. You'll need to pass the bytes and length from the data object.
Peter Hosey
2009-03-29 13:37:06