reading input stream from pipe