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

        final RuntimeFieldFactory<Object> inline = RuntimeFieldFactory
                .getInline(clazz);
        if (inline != null)
        {
            // scalar value
            inline.writeTo(output, inline.id, value, false);
            return;
        }

        // AtomicInteger/AtomicLong
        final Schema<Object> schema = strategy.writePojoIdTo(output, ID_POJO,
                clazz).getSchema();

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

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

@author David Yu
@created Apr 30, 2012
protostuff-runtime/src/main/java/io/protostuff/runtime/NumberSchema.java