public static boolean isPrefix(byte[] prefix, byte[] complete) {
    if (complete.length < prefix.length) {
      return false;
    }
    for (int i = 0; i < prefix.length; ++i) {
      if (complete[i] != prefix[i]) {
        return false;
      }
    }
    return true;
  }
Returns true if the first argument is a prefix of the second argument. Not constant time.
java_src/src/main/java/com/google/crypto/tink/internal/Util.java