rec.setImageMembershipsFlags(imageMembershipsFlags);
serializer.serialize(data, rec);
ByteDataBuffer scratch = scratch();
rec.writeDataTo(scratch);
int ordinal = addData(scratch, imageMembershipsFlags);
scratch.reset();
rec.reset();
if (objectOrdinalMap != null) {
objectOrdinalMap.put(data, ordinal, imageMembershipsFlags);
}