private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
  final ReentrantLock lock=this.lock;
  lock.lock();
  try {
    s.defaultWriteObject();
    for (Node<E> p=first; p != null; p=p.next)     s.writeObject(p.item);
    s.writeObject(null);
  }
  finally {
    lock.unlock();
  }
}

private void writeObject ( java . io . ObjectOutputStream s ) throws java . io . IOException { final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { s . defaultWriteObject ( ) ; for ( Node < E > p = first ; p != null ; p = p . next ) s . writeObject ( p . item ) ; s . writeObject ( null ) ; } finally { lock . unlock ( ) ; } }
save the state of this deque to a stream ( that is , serialize it ) .
