@Override
  public PositionedByteRange putLong(int index, long val) {
    // This writing is same as BB's putLong. When byte[] is wrapped in a BB and
    // call putLong(), one
    // can get the same result.
    for (int i = Bytes.SIZEOF_LONG - 1; i > 0; i--) {
      bytes[offset + index + i] = (byte) val;
      val >>>= 8;
    }
    bytes[offset + index] = (byte) val;
    clearHashCache();
    return this;
  }
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