public static void random(byte[] b, int offset, int length) {
    checkPositionIndex(offset, b.length, "offset");
    checkArgument(length > 0, "length must be greater than 0");
    checkPositionIndex(offset + length, b.length, "offset + length");
    byte[] buf = new byte[length];
    RNG.nextBytes(buf);
    System.arraycopy(buf, 0, b, offset, length);
  }
Fill given array with random bytes at the specified position.
<p>
If you want random bytes generated by a strong source of randomness use
{@link Bytes#secureRandom(byte[], int, int)}.
@param b      array which needs to be filled with random bytes
@param offset staring offset in array
@param length number of bytes to fill
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java