public static char[] toChars(byte[] bytes, String encoding) throws CodecException {
        return toString(bytes, encoding).toCharArray();
    }
Converts the specified byte array to a character array using the specified character encoding.
<p/>
Effectively calls <code>{@link #toString(byte[], String) toString(bytes,encoding)}.{@link String#toCharArray() toCharArray()};</code>

@param bytes    the byte array to convert to a String
@param encoding the character encoding used to encode the bytes.
@return the specified byte array as an encoded char array
@throws CodecException if the JVM does not support the specified encoding.
src/main/java/org/apache/shiro/lang/codec/CodecSupport.java