add ensureCodedBufferSize