docs: @Override
    @SuppressWarnings("unchecked")
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
      super.readExternal(in);
  
      // TODO: do we need to write/read the capacity?
      final int capacity = in.readInt();
      if(isLeaf()) {
        entries = (E[]) new SpatialPointLeafEntry[capacity];
        for(int i = 0; i < numEntries; i++) {
          SpatialPointLeafEntry s = new SpatialPointLeafEntry();
          s.readExternal(in);
          entries[i] = (E) s;
        }
      }
      else {
        entries = (E[]) new SpatialDirectoryEntry[capacity];
        for(int i = 0; i < numEntries; i++) {
          SpatialDirectoryEntry s = new SpatialDirectoryEntry();
          s.readExternal(in);
          entries[i] = (E) s;
        }
      }
    }