put(IEncoder encoder, String fieldName, Object o)
put(IEncoder encoder, String fieldName, Object o, Class<?> clazz)
The one with Class parameter delegates to the one without it if the Object to be serialized is not null. That method uses the object.getClass to determine which serializer to use.
The reason is that if we have a Structure A that has Field1 that has datatype Structure B and we have assigned to that field a Structure C which extends B, we should serialize the Field1 as it were Structure B, because the binary stream does not have identifiers for fields which have structure values, their fields are serialized in order to the stream (see example in spec Part 6, section 5.2.5), so receivers of that stream would have no information that it should try to deserialize C instead of B.