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

Method writeMultiset

output/java_guava/1.4.17/Serialization.java:107–114  ·  view source on GitHub ↗

Stores the contents of a multiset in an output stream, as part of serialization. It does not support concurrent multisets whose content may change while the method is running. The serialized output consists of the number of distinct elements, the first element, its count, the second element, its

(Multiset<E> multiset, ObjectOutputStream stream)

Source from the content-addressed store, hash-verified

105 */
106
107 static <E> void writeMultiset(Multiset<E> multiset, ObjectOutputStream stream) throws IOException {
108 int entryCount = multiset.entrySet().size();
109 stream.writeInt(entryCount);
110 for (Multiset.Entry<E> entry : multiset.entrySet()) {
111 stream.writeObject(entry.getElement());
112 stream.writeInt(entry.getCount());
113 }
114 }
115
116 /**
117 * Populates a multiset by reading an input stream, as part of

Callers 4

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

Calls 6

sizeMethod · 0.65
entrySetMethod · 0.65
writeIntMethod · 0.65
getElementMethod · 0.65
getCountMethod · 0.65
writeObjectMethod · 0.45

Tested by

no test coverage detected