public static byte[] copy(byte[] bytes, final int offset, final int length) {
    if (bytes == null) return null;
    byte[] result = new byte[length];
    System.arraycopy(bytes, offset, result, 0, length);
    return result;
  }
Copy the byte array given in parameter and return an instance of a new byte array with the same
length and the same content.
@param bytes the byte array to copy from
@return a copy of the given designated byte array
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java