New method _get_buffer for stream class.