}
private int decodeDiff(int index, EntityCollection entities) {
index = stream.readEntityIndex(index);
PVS pvs = stream.readEntityPVS();
DTClass cls = null;
Integer serial = null;
Object[] state = null;
List<Integer> propList = null;
Entity entity = null;
switch (pvs) {
case ENTER:
cls = dtClasses.forClassId(stream.readNumericBits(classBits));
serial = stream.readNumericBits(10);
propList = stream.readEntityPropList();
state = decodeBaseProperties(cls);
decodeProperties(state, cls, propList);
entities.add(index, serial, cls, pvs, state);
log.debug(" {} [index={}, serial={}, handle={}, type={}]",
pvs,
index,
serial,
Handle.forIndexAndSerial(index, serial),
cls.getDtName()
);
break;
case PRESERVE:
entity = entities.getByIndex(index);
entity.setPvs(pvs);