@Override public void load(String fileName,InputStream dummy,String dummy2,float dummy3) throws IOException, MaryConfigurationException {
  DataInputStream dis=new DataInputStream(new BufferedInputStream(new FileInputStream(fileName)));
  hdr=new MaryHeader(dis);
  if (hdr.getType() != MaryHeader.PRECOMPUTED_JOINCOSTS) {
    throw new MaryConfigurationException("File [" + fileName + "] is not a valid Mary precompiled join costs file.");
  }
  int numberOfLeftUnits=dis.readInt();
  if (numberOfLeftUnits < 0) {
    throw new MaryConfigurationException("File [" + fileName + "] has a negative number of units. Aborting.");
  }
  left=new HashMap();
  for (int i=0; i < numberOfLeftUnits; i++) {
    int leftIndex=dis.readInt();
    int numberOfRightUnits=dis.readInt();
    Map right=new HashMap();
    left.put(new Integer(leftIndex),right);
    for (int j=0; j < numberOfRightUnits; j++) {
      int rightIndex=dis.readInt();
      float cost=dis.readFloat();
      right.put(new Integer(rightIndex),new Float(cost));
    }
  }
}

@ Override public void load ( String fileName , InputStream dummy , String dummy2 , float dummy3 ) throws IOException , MaryConfigurationException { DataInputStream dis = new DataInputStream ( new BufferedInputStream ( new FileInputStream ( fileName ) ) ) ; hdr = new MaryHeader ( dis ) ; if ( hdr . getType ( ) != MaryHeader . PRECOMPUTED_JOINCOSTS ) { throw new MaryConfigurationException ( "File [" + fileName + "] is not a valid Mary precompiled join costs file." ) ; } int numberOfLeftUnits = dis . readInt ( ) ; if ( numberOfLeftUnits < 0 ) { throw new MaryConfigurationException ( "File [" + fileName + "] has a negative number of units. Aborting." ) ; } left = new HashMap ( ) ; for ( int i = 0 ; i < numberOfLeftUnits ; i ++ ) { int leftIndex = dis . readInt ( ) ; int numberOfRightUnits = dis . readInt ( ) ; Map right = new HashMap ( ) ; left . put ( new Integer ( leftIndex ) , right ) ; for ( int j = 0 ; j < numberOfRightUnits ; j ++ ) { int rightIndex = dis . readInt ( ) ; float cost = dis . readFloat ( ) ; right . put ( new Integer ( rightIndex ) , new Float ( cost ) ) ; } } }
load the given precompiled join cost file
