PropertyRecord currentRecord = createRecord(propertyId);
propertyId++;
int index=0;
holder.propertyRecords[index++] = currentRecord;
for (int i = 0; i < holder.propertyCount; i++) {
Property property = holder.properties[i];
PropertyBlock block = property.block;
if (currentRecord.size() + block.getSize() > PAYLOAD_SIZE){
currentRecord.setNextProp(propertyId);
currentRecord = createRecord(propertyId);
currentRecord.setPrevProp(propertyId-1);
propertyId++;
holder.propertyRecords[index++] = currentRecord;
}
currentRecord.addPropertyBlock(block);
property.cleanValue();
}
if (index<holder.propertyRecords.length) holder.propertyRecords[index]=null;
}