Пример #1
0
 private void writePropertyRecord(PropertyRecord record) throws IOException {
   byte inUse = record.inUse() ? Record.IN_USE.byteValue() : Record.NOT_IN_USE.byteValue();
   if (record.getRelId() != -1) {
     // Here we add 2, i.e. set the second lsb.
     inUse += Record.REL_PROPERTY.byteValue();
   }
   channel.put(inUse); // 1
   channel.putLong(record.getNextProp()).putLong(record.getPrevProp()); // 8 + 8
   long nodeId = record.getNodeId();
   long relId = record.getRelId();
   if (nodeId != -1) {
     channel.putLong(nodeId); // 8 or
   } else if (relId != -1) {
     channel.putLong(relId); // 8 or
   } else {
     // means this records value has not changed, only place in
     // prop chain
     channel.putLong(-1); // 8
   }
   channel.put((byte) record.numberOfProperties()); // 1
   for (PropertyBlock block : record) {
     assert block.getSize() > 0 : record + " seems kinda broken";
     writePropertyBlock(block);
   }
   writeDynamicRecords(record.getDeletedRecords());
 }