System.err.println ("readExternal.");
if (debug) System.out.println ("readExternal.");
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {    System.err.println ("readExternal.");    int numLegs = in.readInt ();    // fill char buffer with leg Strings --------------------------------    char [] legStringBuffer = null;    String legStringString  = null;    int legStringBufferLength = 0;    if (useCompression) {      legStringString = inflateCharArrayToString (in);      legStringBufferLength = legStringString.length();    }    else {      legStringBuffer = (char [])    in.readObject();      legStringBufferLength = legStringBuffer.length;      legStringString = new String(legStringBuffer);    }    CharBuffer charBuffer = CharBuffer.allocate (legStringBufferLength);    charBuffer.put (legStringString);    charBuffer.rewind();    // get longs, ints, and booleans --------------------------------    long [] legLongBuffer     = (long [])    in.readObject();    int  [] legIntBuffer      = (int  [])    in.readObject();    boolean [] legBooleanBuffer  = (boolean []) in.readObject();    // fill asset char buffer with leg asset ids --------------------------------    char [] assetStringBuffer = null;    String assetStringString  = null;    int assetStringBufferLength = 0;    if (useCompression) {      assetStringString = inflateCharArrayToString (in);      assetStringBufferLength = assetStringString.length();    }    else {      assetStringBuffer = (char [])    in.readObject();      assetStringBufferLength = assetStringBuffer.length;      assetStringString = new String(assetStringBuffer);    }    //    System.out.println ("orig size " + legStringBuffer.length + " temp " + temp + " char Buffer is " + charBuffer);    CharBuffer assetCharBuffer = CharBuffer.allocate (assetStringBufferLength);    assetCharBuffer.put (assetStringString);    assetCharBuffer.rewind();    //    System.out.println ("orig size " + assetStringBuffer.length + " temp " + temp +     //			" asset char Buffer is " + assetCharBuffer);    // might want to switch to using LongBuffers for readability    //    LongBuffer longBuffer = LongBuffer.allocate (legLongBuffer.length);    //    longBuffer.put (legLongBuffer);    for (int i = 0; i < numLegs; i++) {      Leg li = new Leg ();      li.readFromBuffer (i, 			 charBuffer,			 legLongBuffer,			 legIntBuffer,			 legBooleanBuffer,			 assetCharBuffer);      addLeg (li);      //      System.out.println ("Leg #" + i + " is\n" + li);    }  }