code: private void writeObject(java.io.ObjectOutputStream s)
          throws java.io.IOException {
          // Write out element count, and any hidden stuff
          s.defaultWriteObject();
  
          // Write out array length, for compatibility with 1.5 version
          s.writeInt(Math.max(2, size + 1));
  
          // Write out all elements in the "proper order".
          for (int i = 0; i < size; i++)
              s.writeObject(queue[i]);
      }
docs: Saves this queue to a stream (that is, serializes it).
  
  @serialData The length of the array backing the instance is
  emitted (int), followed by all of its elements
  (each an {@code Object}) in the proper order.
  @param s the stream
  @throws java.io.IOException if an I/O error occurs