public static String moveToString(final char[] chars) {
        if (STRING_VALUE_OFFSET == -1) {
            // In the off-chance that this JDK does not implement String as we'd expect, just do a copy.
            return new String(chars);
        }
        final String str;
        try {
            str = (String) UNSAFE_ACCESSOR.allocateInstance(String.class);
        } catch (final InstantiationException e) {
            // This should never happen, but return a copy as a fallback just in case.
            return new String(chars);
        }
        UNSAFE_ACCESSOR.putObject(str, STRING_VALUE_OFFSET, chars);
        return str;
    }
Returns a new {@link String} backed by the given {@code chars}.
The char array should not be mutated any more after calling
this function.
jraft-core/src/main/java/com/alipay/sofa/jraft/util/internal/UnsafeUtil.java