Use stream.Transform. Thanks, @maxogden!