@Override
        @SuppressWarnings("unchecked")
        public <T> Field<T> create(int number, java.lang.String name,
                final java.lang.reflect.Field f, IdStrategy strategy)
        {
            Class<Object> type = (Class<Object>) f.getType();
            final long offset = us.objectFieldOffset(f);
            return new RuntimeMessageField<T, Object>(type,
                    strategy.getSchemaWrapper(type, true), FieldType.MESSAGE,
                    number, name, false, f.getAnnotation(Tag.class))
            {
                @Override
                public void mergeFrom(Input input, T message)
                        throws IOException
                {
                    us.putObject(message, offset, input.mergeObject(
                            us.getObject(message, offset), getSchema()));
                }

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

                @Override
                public void transfer(Pipe pipe, Input input, Output output,
                        boolean repeated) throws IOException
                {
                    output.writeObject(number, pipe, getPipeSchema(), repeated);
                }
                
                @Override
                protected Field<T> copy(IdStrategy strategy)
                {
                    return POJO.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