Support generic streams, not just Buffer