Finish mac implementation of customIOstream