public static int encodeBlobCopy(PositionedByteRange dst, byte[] val, Order ord) {
    return encodeBlobCopy(dst, val, 0, null != val ? val.length : 0, ord);
  }
Encode a Blob value as a byte-for-byte copy. BlobCopy encoding in DESCENDING order is NULL
terminated so as to preserve proper sorting of {@code []} and so it does not support
{@code 0x00} in the value.
@return the number of bytes written.
@throws IllegalArgumentException when {@code ord} is DESCENDING and {@code val} contains a
                                 {@code 0x00} byte.
@see #encodeBlobCopy(PositionedByteRange, byte[], int, int, Order)
hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java