public int getLength() {
    if (this.bytes == null) {
      throw new IllegalStateException(
        "Uninitialiized. Null constructor " + "called w/o accompaying readFields invocation");
    }
    return this.length;
  }
Returns the number of valid bytes in the buffer
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java