public static byte[] nextBytes(final byte[] bytes) {
        Requires.requireNonNull(bytes, "bytes");
        final int len = bytes.length;
        if (len == 0) { // fast path
            return new byte[] { 0 };
        }
        final byte[] nextBytes = new byte[len + 1];
        System.arraycopy(bytes, 0, nextBytes, 0, len);
        nextBytes[len] = 0;
        return nextBytes;
    }
This method has better performance than String#String(byte[], Charset),
See the benchmark class: Utf8Benchmark for details.
jraft-core/src/main/java/com/alipay/sofa/jraft/util/BytesUtil.java