Object key = it.getKey();
Object value = it.getValue();
keyType.serialize(key, koi, oprot);
if (value == null) {
assert (nullProtocol != null);
nullProtocol.writeNull();
} else {
valueType.serialize(value, voi, oprot);
}
}
// in theory, the below call isn't needed in non thrift_mode, but let's not