unit test for the whole serialization process

Interface Input DataInput anf DataOutput need to be revised, but I left them unchanged
because the order of fieldInfos is important.
we need to serialize fields in the order they are deserialized
when deserializing, the field array come directly from class: Filed[] fields = clazz.getFields()