reuse buffer to reduce gc overhead