code: public static boolean equalConstantByteArray(byte value, int len, byte[] arr) {
      if (arr == null || arr.length != len) {
        return false;
      }
      for (int k = 0; k < len; k++) {
        if (arr[k] != value) {
          return false;
        }
      }
      return true;
    }
docs: Checks if the given byte array starts with a constant sequence of bytes of the given value
  and length.
  
  @param value the value to check for
  @param len the target length of the sequence
  @param arr the byte array to check
  @return true if the byte array has a prefix of length {@code len} that is a constant
  sequence of bytes of the given value