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

Method writeMap

output/java_guava/1.4.17/Serialization.java:64–70  ·  view source on GitHub ↗

Stores the contents of a map in an output stream, as part of serialization. It does not support concurrent maps whose content may change while the method is running. The serialized output consists of the number of entries, first key, first value, second key, second value, and so on.

(Map<K, V> map, ObjectOutputStream stream)

Source from the content-addressed store, hash-verified

62 */
63
64 static <K, V> void writeMap(Map<K, V> map, ObjectOutputStream stream) throws IOException {
65 stream.writeInt(map.size());
66 for (Map.Entry<K, V> entry : map.entrySet()) {
67 stream.writeObject(entry.getKey());
68 stream.writeObject(entry.getValue());
69 }
70 }
71
72 /**
73 * Populates a map by reading an input stream, as part of deserialization.

Callers 3

writeObjectMethod · 0.95
writeObjectMethod · 0.95
writeObjectMethod · 0.95

Calls 6

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

Tested by

no test coverage detected