public static String toString(byte[] bytes, String charsetName) throws UnsupportedEncodingException {
        return charsetName == null ? new String(bytes) : new String(bytes, charsetName);
    }
Converts a <code>byte[]</code> to a String using the specified character encoding.

@param bytes       the byte array to read from
@param charsetName the encoding to use, if null then use the platform default
@return a new String
@throws UnsupportedEncodingException If the named charset is not supported
@throws NullPointerException         if the input is null
@since 3.1
core/common/src/main/java/com/alipay/sofa/rpc/common/utils/StringUtils.java