@Override
        public <T> Field<T> create(int number, java.lang.String name,
                final java.lang.reflect.Field f, IdStrategy strategy)
        {
            final long offset = us.objectFieldOffset(f);
            return new RuntimeObjectField<T>(
                    f.getType(),
                    FieldType.MESSAGE,
                    number,
                    name,
                    false,
                    f.getAnnotation(Tag.class),
                    PolymorphicSchemaFactories.getFactoryFromField(f, strategy),
                    strategy)
            {
                @Override
                public void mergeFrom(Input input, T message)
                        throws IOException
                {
                    final Object value = input.mergeObject(message, schema);
                    if (input instanceof GraphInput
                            && ((GraphInput) input).isCurrentMessageReference())
                    {
                        // a reference from polymorphic+cyclic graph deser
                        us.putObject(message, offset, value);
                    }
                }

                @Override
                public void writeTo(Output output, T message)
                        throws IOException
                {
                    final Object existing = us.getObject(message, offset);
                    if (existing != null)
                        output.writeObject(number, existing, schema, false);
                }

                @Override
                public void transfer(Pipe pipe, Input input, Output output,
                        boolean repeated) throws IOException
                {
                    output.writeObject(number, pipe, schema.getPipeSchema(),
                            false);
                }

                @Override
                public void setValue(Object value, Object message)
                {
                    us.putObject(message, offset, value);
                }
                
                @Override
                protected Field<T> copy(IdStrategy strategy)
                {
                    return OBJECT.create(number, name, f, strategy);
                }
            };
        }
Field factory via sun.misc.Unsafe.

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