This closes over `bufferedStream`, so you can use it directly and really don't need to pass it in as `stream`.