@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 Field<T>(FieldType.STRING, number, name,
                    f.getAnnotation(Tag.class))
            {
                @Override
                public void mergeFrom(Input input, T message)
                        throws IOException
                {
                    us.putObject(message, offset, input.readString());
                }

                @Override
                public void writeTo(Output output, T message)
                        throws IOException
                {
                    CharSequence value = (CharSequence) us.getObject(message, offset);
                    if (value != null)
                        output.writeString(number, value, false);
                }

                @Override
                public void transfer(Pipe pipe, Input input, Output output,
                        boolean repeated) throws IOException
                {
                    input.transferByteRangeTo(output, true, number, repeated);
                }
            };
        }
Field factory via sun.misc.Unsafe.

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