code: public static int partialIsValidUtf8(
        byte[] bytes, int index, int limit) {
      // Optimize for 100% ASCII.
      // Hotspot loves small simple top-level loops like this.
      while (index < limit && bytes[index] >= 0) {
        index++;
      }
  
      return (index >= limit) ? COMPLETE :
          partialIsValidUtf8NonAscii(bytes, index, limit);
    }
docs: Tells whether the given byte array slice is a well-formed,
  malformed, or incomplete UTF-8 byte sequence.  The range of bytes
  to be checked extends from index {@code index}, inclusive, to
  {@code limit}, exclusive.
  
  <p>This is a convenience method, equivalent to a call to {@code
  partialIsValidUtf8(Utf8.COMPLETE, bytes, index, limit)}.
  
  @return {@link #MALFORMED} if the partial byte sequence is
  definitely not well-formed, {@link #COMPLETE} if it is well-formed
  (no additional input needed), or if the byte sequence is
  "incomplete", i.e. apparently terminated in the middle of a character,
  an opaque integer "state" value containing enough information to
  decode the character when passed to a subsequent invocation of a
  partial decoding method.