code: void fillEntries(TableKelp table,
                     TreeSet<TreeEntry> set,
                     int index)
    {
      byte []buffer = getBuffer();
      
      int keyLength = table.getKeyLength();
      int len = table.row().getTreeItemLength();
      
      for (int ptr = index; ptr < BLOCK_SIZE; ptr += len) {
        int code = buffer[ptr] & 0xff;
        
        int min = ptr + 1;
        int max = min + keyLength;
        
        int valueOffset = max + keyLength;
  
        byte []minKey = new byte[keyLength];
        byte []maxKey = new byte[keyLength];
        
        System.arraycopy(buffer, min, minKey, 0, keyLength);
        System.arraycopy(buffer, max, maxKey, 0, keyLength);
        
        int pid = BitsUtil.readInt(buffer, valueOffset);
        TreeEntry entry = new TreeEntry(minKey, maxKey, code, pid);
        
        set.add(entry);
      }
    }
docs: /*
  void write(MaukaDatabase db, WriteStream os, int index)
  throws IOException
  {
  byte []buffer = getBuffer();
  
  int keyLength = db.getKeyLength();
  int len = 2 * keyLength + 5;
  
  for (int ptr = index; ptr < BLOCK_SIZE; ptr += len) {
  int code = buffer[ptr] & 0xff;
  
  if (code != INSERT) {
  continue;
  }
  
  int pid = BitsUtil.readInt(buffer, ptr + len - 4);
  
  if (pid == 0) {
  throw new IllegalStateException();
  }
  
  os.write(buffer, ptr + 1, len - 1);
  }
  }