public int append(BytesRef bytes) {if (lastElement >= offsets.length) {int oldLen = offsets.length;offsets = ArrayUtil.grow(offsets, offsets.length + 1);bytesUsed.addAndGet((offsets.length - oldLen) * Integer.BYTES);}pool.append(bytes);offsets[lastElement++] = currentOffset;currentOffset += bytes.length;return lastElement-1;}

public int Append(BytesRef bytes){if (lastElement >= offsets.Length){int oldLen = offsets.Length;offsets = ArrayUtil.Grow(offsets, offsets.Length + 1);bytesUsed.AddAndGet((offsets.Length - oldLen) * RamUsageEstimator.NUM_BYTES_INT32);}pool.Append(bytes);offsets[lastElement++] = currentOffset;currentOffset += bytes.Length;return lastElement - 1;}
