Reads data from the input queue and returns it in a sequence. The data is read until an error is raised (such as EOF).