nomenStringBuffer, typeIDStringBuffer, weightDoubleBuffer);
nomenStringBuffer, typeIDStringBuffer, receiversStringBuffer, weightDoubleBuffer);
  public void writeExternal(ObjectOutput out) throws IOException {    try {    int numInstances = instances.values().size();    out.writeInt (numInstances);        //    System.out.println ("Writing " + numInstances + " instances.");    char [] instanceStringBuffer = new char [numInstances * Instance.numString * Instance.maxStringLength];    long [] instanceLongBuffer   = new long [numInstances * Instance.numLong];    int  [] instanceIntBuffer    = new int  [numInstances * Instance.numInt];    boolean [] instanceBooleanBuffer = new boolean [numInstances * Instance.numBoolean];    Iterator iter = getInstancesIterator();    int index = 0;    int totalManifestItems = 0;    List agentNames   = new ArrayList ();    int [] uidAgentIndex = new int  [numInstances*Instance.numUID];    long [] uidLong      = new long [numInstances*Instance.numUID];    while(iter.hasNext()){      Instance instance = (Instance)iter.next();      totalManifestItems = instance.writeToBuffer (index++, 						   agentNames,						   uidAgentIndex,						   uidLong,						   instanceStringBuffer, 						   instanceLongBuffer, 						   instanceIntBuffer, 						   instanceBooleanBuffer);    }    char [] nomenStringBuffer  = new char [totalManifestItems * Instance.maxStringLength];    char [] typeIDStringBuffer = new char [totalManifestItems * Instance.maxStringLength];    double [] weightDoubleBuffer = new double [totalManifestItems];    index = 0;    iter = getInstancesIterator();    while(iter.hasNext()){      Instance instance = (Instance)iter.next();      if (instance.hasManifest)	index = instance.writeToManifestBuffers (index, 						 nomenStringBuffer, typeIDStringBuffer, weightDoubleBuffer);    }    //    System.out.println ("AgentNames is " + agentNames);    //    System.out.println ("instance string is " + new String (instanceStringBuffer));    //    System.out.println ("nomen string is " + new String (nomenStringBuffer));    out.writeObject(agentNames);    out.writeObject(uidAgentIndex);    out.writeObject(uidLong);    out.writeObject(instanceStringBuffer);    out.writeObject(instanceLongBuffer);    out.writeObject(instanceIntBuffer);    out.writeObject(instanceBooleanBuffer);    out.writeObject(nomenStringBuffer);    out.writeObject(typeIDStringBuffer);    out.writeObject(weightDoubleBuffer);    } catch (Exception e) { e.printStackTrace (); }  }