ray points out that IntSetStat's size can also, of course, be stored in a byte

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@660 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Tom Conkling
2008-07-16 20:47:25 +00:00
parent 8f12cff519
commit cf1779e8b8
@@ -61,7 +61,7 @@ public class IntSetStat extends Stat
throws IOException
{
out.writeByte(_maxSize - 128);
out.writeInt(_intSet.size());
out.writeByte(_intSet.size() - 128);
for (int key : _intSet) {
out.writeInt(key);
}
@@ -71,8 +71,8 @@ public class IntSetStat extends Stat
public void unpersistFrom (ObjectInputStream in, AuxDataSource aux)
throws IOException, ClassNotFoundException
{
_maxSize = in.readByte() + 128;
int numValues = in.readInt();
_maxSize = ((int)in.readByte()) + 128;
int numValues = ((int)in.readByte()) + 128;
_intSet = new HashSet<Integer>(numValues);
for (int ii = 0; ii < numValues; ii++) {
_intSet.add(in.readInt());