protected byte[] objectToBytes(Object o) {
        String msg = "The " + getClass().getName() + " implementation only supports conversion to "
                + "byte[] if the source is of type byte[], char[], String, " + ByteSource.class.getName()
                + " File or InputStream.  The instance provided as a method "
                + "argument is of type [" + o.getClass().getName() + "].  If you would like to convert "
                + "this argument type to a byte[], you can 1) convert the argument to one of the supported types "
                + "yourself and then use that as the method argument or 2) subclass " + getClass().getName()
                + "and override the objectToBytes(Object o) method.";
        throw new CodecException(msg);
    }
Default implementation throws a CodecException immediately since it can't infer how to convert the Object
to a byte array.  This method must be overridden by subclasses if anything other than the three default
types (listed in the {@link #toBytes(Object) toBytes(Object)} JavaDoc) are to be converted to a byte array.

@param o the Object to convert to a byte array.
@return a byte array representation of the Object argument.
lang/src/main/java/org/apache/shiro/lang/codec/CodecSupport.java