@Override
        public <T> Field<T> create(int number, String name,
                final java.lang.reflect.Field f, IdStrategy strategy)
        {
            final long offset = us.objectFieldOffset(f);
            return new Field<T>(FieldType.BYTES, number, name,
                    f.getAnnotation(Tag.class))
            {
                @Override
                public void mergeFrom(Input input, T message)
                        throws IOException
                {
                    us.putObject(message, offset,
                            new BigInteger(input.readByteArray()));
                }

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

                @Override
                public void transfer(Pipe pipe, Input input, Output output,
                        boolean repeated) throws IOException
                {
                    input.transferByteRangeTo(output, false, 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