@Override
  public String toString() {
    StringBuilder sb = new StringBuilder(3 * this.length);
    final int endIdx = this.offset + this.length;
    for (int idx = this.offset; idx < endIdx; idx++) {
      sb.append(' ');
      String num = Integer.toHexString(0xff & this.bytes[idx]);
      // if it is only one digit, add a leading 0.
      if (num.length() < 2) {
        sb.append('0');
      }
      sb.append(num);
    }
    return sb.length() > 0 ? sb.substring(1) : "";
  }
Compares the bytes in this object to the specified byte array
@return Positive if left is bigger than right, 0 if they are equal, and negative if left is
        smaller than right.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/ImmutableBytesWritable.java