public void writeTo(Output output, T message)
                        throws IOException
                {
                    try
                    {
                        if (primitive)
                            output.writeInt32(number, f.getInt(message), false);
                        else
                        {
                            Integer value = (Integer) f.get(message);
                            if (value != null)
                                output.writeInt32(number, value.intValue(),
                                        false);
                        }
                    }
                    catch (IllegalAccessException e)
                    {
                        throw new RuntimeException(e);
                    }
                    catch (IllegalArgumentException e)
                    {
                        throw new RuntimeException(e);
                    }
                }
Field factory via plain old reflection api.

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