private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
  s.defaultReadObject();
  count.set(0);
  last=head=new Node<E>(null);
  for (; ; ) {
    @SuppressWarnings("unchecked") E item=(E)s.readObject();
    if (item == null)     break;
    add(item);
  }
}

private void readObject ( java . io . ObjectInputStream s ) throws java . io . IOException , ClassNotFoundException { s . defaultReadObject ( ) ; count . set ( 0 ) ; last = head = new Node < E > ( null ) ; for ( ; ; ) { @ SuppressWarnings ( "unchecked" ) E item = ( E ) s . readObject ( ) ; if ( item == null ) break ; add ( item ) ; } }
reconstitutes this queue from a stream ( that is , deserializes it ) .
