code: public final void saveState(final OutputStream outStream) {
          Validate.validState(crawlFrontier != null, "Cannot save state at this point.");
  
          CrawlerState state = new CrawlerState();
          state.putStateObject(config);
          state.putStateObject(crawlFrontier);
  
          SerializationUtils.serialize(state, outStream);
      }
docs: Saves the current state of the crawler to the given output stream.
  
  @param outStream the output stream