if buffer_.size() == to_read, it will not allocate the extra +1