public boolean addRef(Object object) throws IOException {
  if (_refs == null)   _refs=new IdentityHashMap();
  Integer ref=(Integer)_refs.get(object);
  if (ref != null) {
    int value=ref.intValue();
    writeRef(value);
    return true;
  }
 else {
    _refs.put(object,new Integer(_refs.size()));
    return false;
  }
}

public boolean addRef ( Object object ) throws IOException { if ( _refs == null ) _refs = new IdentityHashMap ( ) ; Integer ref = ( Integer ) _refs . get ( object ) ; if ( ref != null ) { int value = ref . intValue ( ) ; writeRef ( value ) ; return true ; } else { _refs . put ( object , new Integer ( _refs . size ( ) ) ) ; return false ; } }
if the object has already been written , just write its ref .
