@Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    setPageID(in.readInt());
    isLeaf = in.readBoolean();
    supernode = in.readBoolean();
    numEntries = in.readInt();

    final int capacity = in.readInt();
    if(supernode) {
      // this node is a supernode and is yet to be filled
      capacity_to_be_filled = capacity;
      return;
    }
    // the following causes a null pointer -- something is obviously missing
    // entries = (E[]) java.lang.reflect.Array.newInstance(eclass, capacity);
    if(isLeaf()) {
      entries = (Entry[]) new SpatialPointLeafEntry[capacity];
    }
    else {
      entries = (Entry[]) new XTreeDirectoryEntry[capacity];
    }
    for(int i = 0; i < numEntries; i++) {
      SpatialEntry s = isLeaf() ? new SpatialPointLeafEntry() : new XTreeDirectoryEntry();
      s.readExternal(in);
      entries[i] = s;
    }
  }
@ Override public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { setPageID ( in . readInt ( ) ) ; isLeaf = in . readBoolean ( ) ; supernode = in . readBoolean ( ) ; numEntries = in . readInt ( ) ; final int capacity = in . readInt ( ) ; if ( supernode ) { capacity_to_be_filled = capacity ; return ; } if ( isLeaf ( ) ) { entries = ( Entry [ ] ) new SpatialPointLeafEntry [ capacity ] ; } else { entries = ( Entry [ ] ) new XTreeDirectoryEntry [ capacity ] ; } for ( int i = 0 ; i < numEntries ; i ++ ) { SpatialEntry s = isLeaf ( ) ? new SpatialPointLeafEntry ( ) : new XTreeDirectoryEntry ( ) ; s . readExternal ( in ) ; entries [ i ] = s ; } }
Reads the id of this node, the numEntries and the entries array from the
specified stream. If the {@link #supernode} field is set, <code>this</code>
cannot be contained in <code>in</code>. Such a node has to be manually
filled using {@link #readSuperNode(ObjectInput, AbstractXTree)}.

@param in the stream to read data from in order to restore the object
@throws java.io.IOException if I/O errors occur
@throws ClassNotFoundException If the class for an object being restored
cannot be found.