public int byteIndexOf(int utf8CharIndex) {
        if (utf8CharIndex < 0) {
            throw new IndexOutOfBoundsException("The index must be greater than or equal to 0");
        }
        if (utf8CharIndex >= charCount) {
            throw new IndexOutOfBoundsException(
                    "The index must be less than "
                            + charCount);
        }
        int firstByteIndex = byteOffset;
        int endByteIndex = byteOffset + byteCount;
        int seenCharacters = 0;
        byte[] localBytes = bytes;
        byte firstByte;
        while (seenCharacters < utf8CharIndex && firstByteIndex < endByteIndex) {
            firstByte = localBytes[firstByteIndex];
            int count = getByteCountFromFirstUtf8Byte(firstByte);
            if (count > 0) {
                firstByteIndex += count;
                seenCharacters++;
            }
        }
        return firstByteIndex;
    }
@return the start byte index of the UTF-8 char
turms-server-common/src/main/java/im/turms/server/common/infra/lang/Utf8String.java