@SuppressWarnings("unchecked")
    static void writeObjectTo(Output output, Object value,
            Schema<?> currentSchema, IdStrategy strategy) throws IOException
    {
        final Schema<Object> schema = strategy.writePojoIdTo(output,
                ID_THROWABLE, (Class<Object>) value.getClass()).getSchema();

        if (output instanceof StatefulOutput)
        {
            // update using the derived schema.
            ((StatefulOutput) output).updateLast(schema, currentSchema);
        }

        if (tryWriteWithoutCause(output, value, schema))
            return;

        schema.writeTo(output, value);
    }
Used when the type is assignable from {@link java.lang.Throwable}.

@author David Yu
@created May 2, 2012
protostuff-runtime/src/main/java/io/protostuff/runtime/PolymorphicThrowableSchema.java