@Override
    public byte[] getKey() {
      int keylength = getKeyLength();
      byte[] key = new byte[keylength];
      System.arraycopy(this.bytes, getKeyOffset(), key, 0, keylength);
      return key;
    }
A setter that helps to avoid object creation every time and whenever there is a need to
create new KeyOnlyKeyValue.
@param key    Key to set
@param offset Offset of the Key
@param length length of the Key
hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java