@Override
  public int putVLong(int index, long val) {
    int rPos = 0;
    while (true) {
      if ((val & ~0x7F) == 0) {
        bytes[offset + index + rPos] = (byte) val;
        break;
      } else {
        bytes[offset + index + rPos] = (byte) ((val & 0x7F) | 0x80);
        val >>>= 7;
      }
      rPos++;
    }
    clearHashCache();
    return rPos + 1;
  }
Update the length of this range. {@code offset + length} should not be greater than
{@code bytes.length}. If {@code position} is greater than the new {@code length}, sets
{@code position} to {@code length}. The new length of this range.
@return this.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/SimplePositionedMutableByteRange.java