@Override
  public int encodedLength(byte[] val) {
    return null == val
      ? (Order.ASCENDING == order ? 1 : 2)
      : (Order.ASCENDING == order ? val.length + 1 : val.length + 2);
  }
Creates a new {@code byte[]} with variable length.
@param order the {@link Order} to use
hbase-common/src/main/java/org/apache/hadoop/hbase/types/OrderedBlob.java