code: private void writeObject(java.io.ObjectOutputStream s)
          throws java.io.IOException  {
          // Write out and any hidden stuff
          s.defaultWriteObject();
  
          // Write out size (number of Mappings)
          s.writeInt(size);
  
          // Write out keys and values (alternating)
          Object[] tab = table;
          for (int i = 0; i < tab.length; i += 2) {
              Object key = tab[i];
              if (key != null) {
                  s.writeObject(unmaskNull(key));
                  s.writeObject(tab[i + 1]);
              }
          }
      }
docs: Saves the state of the <tt>IdentityHashMap</tt> instance to a stream
  (i.e., serializes it).
  
  @serialData The <i>size</i> of the HashMap (the number of key-value
  mappings) (<tt>int</tt>), followed by the key (Object) and
  value (Object) for each key-value mapping represented by the
  IdentityHashMap.  The key-value mappings are emitted in no
  particular order.