}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
int size = in.readInt();
MutableShortBag deserializedBag = new ShortHashBag();
for (int i = 0; i < size; i++)
{
deserializedBag.addOccurrences(in.readShort(), in.readInt());
}
this.bag = deserializedBag;
}