static <K, V> void writeMultimap(Multimap<K, V> multimap, ObjectOutputStream stream)
      throws IOException {
    stream.writeInt(multimap.asMap().size());
    for (Map.Entry<K, Collection<V>> entry : multimap.asMap().entrySet()) {
      stream.writeObject(entry.getKey());
      stream.writeInt(entry.getValue().size());
      for (V value : entry.getValue()) {
        stream.writeObject(value);
      }
    }
  }
static <K, V> void writeMultimap(Multimap<K, V> multimap, ObjectOutputStream stream)
      throws IOException {
    stream.writeInt(multimap.asMap().size());
    for (Map.Entry<K, Collection<V>> entry : multimap.asMap().entrySet()) {
      stream.writeObject(entry.getKey());
      stream.writeInt(entry.getValue().size());
      for (V value : entry.getValue()) {
        stream.writeObject(value);
      }
    }
  }
static < K , V > void writeMultimap ( Multimap < K , V > multimap , ObjectOutputStream stream ) throws IOException { stream . writeInt ( multimap . asMap ( ) . size ( ) ) ; for ( Map . Entry < K , Collection < V > > entry : multimap . asMap ( ) . entrySet ( ) ) { stream . writeObject ( entry . getKey ( ) ) ; stream . writeInt ( entry . getValue ( ) . size ( ) ) ; for ( V value : entry . getValue ( ) ) { stream . writeObject ( value ) ; } } }
Stores the contents of a multimap in an output stream, as part of serialization. It does not
support concurrent multimaps whose content may change while the method is running. The {@link
Multimap#asMap} view determines the ordering in which data is written to the stream.

<p>The serialized output consists of the number of distinct keys, and then for each distinct
key: the key, the number of values for that key, and the key's values.
Stores the contents of a multimap in an output stream as part of serialization . It does not support concurrent multimaps whose content may change while the method is running . The { @link Multimap#asMap } view determines the ordering in which data is written to the stream .