private void loadBinary(DataInputStream is) throws IOException {
  if (is.readInt() != MAGIC) {
    throw new Error("Bad magic in db");
  }
  if (is.readInt() != VERSION) {
    throw new Error("Bad VERSION in db");
  }
  continuityWeight=is.readInt();
  optimalCoupling=is.readInt();
  extendSelections=is.readInt();
  joinMethod=is.readInt();
  joinWeightShift=is.readInt();
  int weightLength=is.readInt();
  joinWeights=new int[weightLength];
  for (int i=0; i < joinWeights.length; i++) {
    joinWeights[i]=is.readInt();
  }
  int unitsLength=is.readInt();
  units=new DatabaseClusterUnit[unitsLength];
  for (int i=0; i < units.length; i++) {
    units[i]=new DatabaseClusterUnit(is);
  }
  int unitTypesLength=is.readInt();
  unitTypes=new UnitType[unitTypesLength];
  for (int i=0; i < unitTypes.length; i++) {
    unitTypes[i]=new UnitType(is);
  }
  sts=new SampleSet(is);
  mcep=new SampleSet(is);
  int numCarts=is.readInt();
  cartMap=new HashMap();
  for (int i=0; i < numCarts; i++) {
    String name=Utilities.getString(is);
    CART cart=CARTImpl.loadBinary(is);
    cartMap.put(name,cart);
    if (defaultCart == null) {
      defaultCart=cart;
    }
  }
}

private void loadBinary ( DataInputStream is ) throws IOException { if ( is . readInt ( ) != MAGIC ) { throw new Error ( "Bad magic in db" ) ; } if ( is . readInt ( ) != VERSION ) { throw new Error ( "Bad VERSION in db" ) ; } continuityWeight = is . readInt ( ) ; optimalCoupling = is . readInt ( ) ; extendSelections = is . readInt ( ) ; joinMethod = is . readInt ( ) ; joinWeightShift = is . readInt ( ) ; int weightLength = is . readInt ( ) ; joinWeights = new int [ weightLength ] ; for ( int i = 0 ; i < joinWeights . length ; i ++ ) { joinWeights [ i ] = is . readInt ( ) ; } int unitsLength = is . readInt ( ) ; units = new DatabaseClusterUnit [ unitsLength ] ; for ( int i = 0 ; i < units . length ; i ++ ) { units [ i ] = new DatabaseClusterUnit ( is ) ; } int unitTypesLength = is . readInt ( ) ; unitTypes = new UnitType [ unitTypesLength ] ; for ( int i = 0 ; i < unitTypes . length ; i ++ ) { unitTypes [ i ] = new UnitType ( is ) ; } sts = new SampleSet ( is ) ; mcep = new SampleSet ( is ) ; int numCarts = is . readInt ( ) ; cartMap = new HashMap ( ) ; for ( int i = 0 ; i < numCarts ; i ++ ) { String name = Utilities . getString ( is ) ; CART cart = CARTImpl . loadBinary ( is ) ; cartMap . put ( name , cart ) ; if ( defaultCart == null ) { defaultCart = cart ; } } }
loads the database from the given input stream .
