public static String keyToString(final byte[] b, final int o, final int l) {
    if (b == null) {
      return "";
    }
    int rowlength = Bytes.toShort(b, o);
    String row = Bytes.toStringBinary(b, o + Bytes.SIZEOF_SHORT, rowlength);
    int columnoffset = o + Bytes.SIZEOF_SHORT + 1 + rowlength;
    int familylength = b[columnoffset - 1];
    int columnlength = l - ((columnoffset - o) + TIMESTAMP_TYPE_SIZE);
    String family = familylength == 0 ? "" : Bytes.toStringBinary(b, columnoffset, familylength);
    String qualifier = columnlength == 0
      ? ""
      : Bytes.toStringBinary(b, columnoffset + familylength, columnlength - familylength);
    long timestamp = Bytes.toLong(b, o + (l - TIMESTAMP_TYPE_SIZE));
    String timestampStr = humanReadableTimestamp(timestamp);
    byte type = b[o + l - 1];
    return row + "/" + family + (family != null && family.length() > 0 ? ":" : "") + qualifier + "/"
      + timestampStr + "/" + Type.codeToType(type);
  }
Use for logging.
@param b Key portion of a KeyValue.
@param o Offset to start of key
@param l Length of key.
@return Key as a String.
hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java