static String bytesToHex(byte[] buf, int offset, int length) {
    String bufferContents = buf != null ? Bytes.toStringBinary(buf, offset, length) : "<null>";
    return ", KeyValueBytesHex=" + bufferContents + ", offset=" + offset + ", length=" + length;
  }
Write out a KeyValue in the manner in which we used to when KeyValue was a Writable.
@return Length written on stream
@see #create(DataInput) for the inverse function
hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java