public ByteArrayWrapper ensureCapacity(int capacity) {
    if (bytes == null || bytes.length < capacity) {
      byte[] newBytes = new byte[capacity];
      if (bytes != null) {
        copyBytes(bytes, 0, newBytes, 0, size);
      }
      bytes = newBytes;
    }
    return this;
  }
Ensure that the internal byte array is at least of length capacity. If the byte array is null
or its length is less than capacity, a new byte array of length capacity will be allocated. The
contents of the array (between 0 and size) remain unchanged.

@param capacity minimum length of internal byte array.
@return this ByteArrayWrapper
amoro-format-mixed/amoro-mixed-flink/amoro-mixed-flink-common/src/main/java/org/apache/amoro/flink/lookup/ByteArrayWrapper.java