get data from stream