Rewrote ITextStream (not tested yet)