MCPcopy Create free account
hub / github.com/antlr/codebuff / writeMultimap

Method writeMultimap

output/java_guava/1.4.18/Serialization.java:152–161  ·  view source on GitHub ↗

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 Multimap#asMap view determines the ordering in which data is written to the stream. The serialized output co

(Multimap<K, V> multimap, ObjectOutputStream stream)

Source from the content-addressed store, hash-verified

150 */
151
152 static <K, V> void writeMultimap(Multimap<K, V> multimap, ObjectOutputStream stream) throws IOException {
153 stream.writeInt(multimap.asMap().size());
154 for (Map.Entry<K, Collection<V>> entry : multimap.asMap().entrySet()) {
155 stream.writeObject(entry.getKey());
156 stream.writeInt(entry.getValue().size());
157 for (V value : entry.getValue()) {
158 stream.writeObject(value);
159 }
160 }
161 }
162
163 /**
164 * Populates a multimap by reading an input stream, as part of

Callers 5

writeObjectMethod · 0.95
writeObjectMethod · 0.95
writeObjectMethod · 0.95
writeObjectMethod · 0.95
writeObjectMethod · 0.95

Calls 7

writeIntMethod · 0.65
sizeMethod · 0.65
asMapMethod · 0.65
entrySetMethod · 0.65
getKeyMethod · 0.65
getValueMethod · 0.65
writeObjectMethod · 0.45

Tested by

no test coverage detected