change OutputStream to use Text class