get input stream to string