int typeId = TypeHelper.GetTypeId(type);
outStream.WriteInt32(typeId);
if (outStream.WriteRef(obj)) {
return;
}
GKeyValuePair obj2 = (GKeyValuePair) obj;
Object key = obj2.getKey();
Object value = obj2.getValue();
Class itemKeyType = key.getClass();
int itemKeyTypeId = TypeHelper.GetTypeId(itemKeyType);
outStream.WriteInt32(itemKeyTypeId);
SerializerFactory.GetSerializer(itemKeyType).WriteObject(key, outStream);