Support generic streams, not just Buffer

@purplefox can you review this ?
Because I'm not sure what a good value is :)