Use iter() + sentinel to read data from a stream