From a41128f93dd8bf9e09207bb79706100f7e91e586 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Sat, 11 Mar 2006 02:42:21 +0000 Subject: [PATCH] Broke streaming backwards compatibility, only stream the ints that matter. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3937 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/util/StreamableArrayIntSet.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/util/StreamableArrayIntSet.java b/src/java/com/threerings/util/StreamableArrayIntSet.java index cb192a1e5..0e1fff61a 100644 --- a/src/java/com/threerings/util/StreamableArrayIntSet.java +++ b/src/java/com/threerings/util/StreamableArrayIntSet.java @@ -1,5 +1,5 @@ // -// $Id: StreamableArrayIntSet.java,v 1.3 2004/08/27 02:20:36 mdb Exp $ +// $Id$ // // Narya library - tools for developing networked games // Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved @@ -60,7 +60,9 @@ public class StreamableArrayIntSet extends ArrayIntSet throws IOException { out.writeInt(_size); - out.writeObject(_values); + for (int ii = 0; ii < _size; ii++) { + out.writeInt(_values[ii]); + } } /** @@ -70,6 +72,9 @@ public class StreamableArrayIntSet extends ArrayIntSet throws IOException, ClassNotFoundException { _size = in.readInt(); - _values = (int[]) in.readObject(); + _values = new int[Math.max(_size, DEFAULT_CAPACITY)]; + for (int ii = 0; ii < _size; ii++) { + _values[ii] = in.readInt(); + } } }