public static String encodeToString(byte[] bytes) {
        byte[] encoded = encode(bytes);
        return CodecSupport.toString(encoded);
    }
Base64 encodes the specified byte array and then encodes it as a String using Shiro's preferred character
encoding (UTF-8).

@param bytes the byte array to Base64 encode.
@return a UTF-8 encoded String of the resulting Base64 encoded byte array.
src/main/java/org/apache/shiro/lang/codec/Base64.java