Abstract streams to deal with buffers