code: private void readObject(java.io.ObjectInputStream s)
          throws java.io.IOException, ClassNotFoundException  {
          // Read in any hidden stuff
          s.defaultReadObject();
  
          // Read in size (number of Mappings)
          int size = s.readInt();
          if (size < 0)
              throw new java.io.StreamCorruptedException
                  ("Illegal mappings count: " + size);
          init(capacity(size));
  
          // Read the keys and values, and put the mappings in the table
          for (int i=0; i<size; i++) {
              @SuppressWarnings("unchecked")
                  K key = (K) s.readObject();
              @SuppressWarnings("unchecked")
                  V value = (V) s.readObject();
              putForCreate(key, value);
          }
      }
docs: Reconstitutes the <tt>IdentityHashMap</tt> instance from a stream (i.e.,
  deserializes it).