code: private void readObject(java.io.ObjectInputStream s)
          throws java.io.IOException, ClassNotFoundException {
          // Read in size, and any hidden stuff
          s.defaultReadObject();
  
          // Read in (and discard) array length
          s.readInt();
  
          queue = new Object[size];
  
          // Read in all elements.
          for (int i = 0; i < size; i++)
              queue[i] = s.readObject();
  
          // Elements are guaranteed to be in "proper order", but the
          // spec has never explained what that might be.
          heapify();
      }
docs: Reconstitutes the {@code PriorityQueue} instance from a stream
  (that is, deserializes it).
  
  @param s the stream
  @throws ClassNotFoundException if the class of a serialized object
  could not be found
  @throws java.io.IOException if an I/O error occurs