public static KeyValue createKeyValueFromKey(final byte[] b, final int o, final int l) {
    byte[] newb = new byte[l + KeyValue.ROW_OFFSET];
    System.arraycopy(b, o, newb, KeyValue.ROW_OFFSET, l);
    Bytes.putInt(newb, 0, l);
    Bytes.putInt(newb, Bytes.SIZEOF_INT, 0);
    return new KeyValue(newb);
  }
Return a KeyValue made of a byte array that holds the key-only part. Needed to convert hfile
index members to KeyValues.
hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java