private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
  s.defaultReadObject();
  if (loadFactor <= 0 || Float.isNaN(loadFactor))   throw new StreamCorruptedException("Illegal Load: " + loadFactor);
  int origlength=s.readInt();
  int elements=s.readInt();
  if (elements < 0)   throw new StreamCorruptedException("Illegal # of Elements: " + elements);
  origlength=Math.max(origlength,(int)(elements / loadFactor) + 1);
  int length=(int)((elements + elements / 20) / loadFactor) + 3;
  if (length > elements && (length & 1) == 0)   length--;
  length=Math.min(length,origlength);
  table=new Entry<?,?>[length];
  threshold=(int)Math.min(length * loadFactor,MAX_ARRAY_SIZE + 1);
  count=0;
  for (; elements > 0; elements--) {
    @SuppressWarnings("unchecked") K key=(K)s.readObject();
    @SuppressWarnings("unchecked") V value=(V)s.readObject();
    reconstitutionPut(table,key,value);
  }
}

private void readObject ( java . io . ObjectInputStream s ) throws IOException , ClassNotFoundException { s . defaultReadObject ( ) ; if ( loadFactor <= 0 || Float . isNaN ( loadFactor ) ) throw new StreamCorruptedException ( "Illegal Load: " + loadFactor ) ; int origlength = s . readInt ( ) ; int elements = s . readInt ( ) ; if ( elements < 0 ) throw new StreamCorruptedException ( "Illegal # of Elements: " + elements ) ; origlength = Math . max ( origlength , ( int ) ( elements / loadFactor ) + 1 ) ; int length = ( int ) ( ( elements + elements / 20 ) / loadFactor ) + 3 ; if ( length > elements && ( length & 1 ) == 0 ) length -- ; length = Math . min ( length , origlength ) ; table = new Entry < ? , ? > [ length ] ; threshold = ( int ) Math . min ( length * loadFactor , MAX_ARRAY_SIZE + 1 ) ; count = 0 ; for ( ; elements > 0 ; elements -- ) { @ SuppressWarnings ( "unchecked" ) K key = ( K ) s . readObject ( ) ; @ SuppressWarnings ( "unchecked" ) V value = ( V ) s . readObject ( ) ; reconstitutionPut ( table , key , value ) ; } }
reconstitute the hashtable from a stream ( i . e . , deserialize it ) .
