I already thought about that. The second idea is keeping instream and outstream separate, wich would also have the advantage of separate input and output pointers.
But maybe someone comes up with some other good idea. I am wondering, if there is even an ios-flag to control that.