@Override
                public void doMergeFrom(Input input, Schema<Object> schema,
                        Object message) throws IOException
                {
                    final Object existing = us.getObject(message, offset);

                    // merge if not null and is same type.
                    final Object value = existing == null
                            || existing.getClass() != schema.typeClass() ? schema
                            .newMessage() : existing;

                    if (input instanceof GraphInput)
                    {
                        // update the actual reference.
                        ((GraphInput) input).updateLast(value, message);
                    }

                    schema.mergeFrom(input, value);

                    us.putObject(message, offset, value);
                }
Field factory via sun.misc.Unsafe.

@author David Yu
@created Jul 7, 2011
protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeUnsafeFieldFactory.java