From dae0f7f44f8273ebf842252c24da42e36e799b59 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 24 Sep 2009 20:13:39 +0000 Subject: [PATCH] Fuckit, let's use uint paramters and make the default uint.MAX_VALUE. Unless I have to roll this back because the like compiler in CS3 shits its pants trying to understand it (external references for default parameter values seem to sometimes fail). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5969 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/io/ObjectInputStream.as | 5 +++-- src/as/com/threerings/io/ObjectOutputStream.as | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/as/com/threerings/io/ObjectInputStream.as b/src/as/com/threerings/io/ObjectInputStream.as index 8d910a108..209b5692e 100644 --- a/src/as/com/threerings/io/ObjectInputStream.as +++ b/src/as/com/threerings/io/ObjectInputStream.as @@ -202,11 +202,12 @@ public class ObjectInputStream * Read bytes into the byte array. If length is not specified, then * enough bytes to fill the array (from the offset) are read. */ - public function readBytes (bytes :ByteArray, offset :int = 0, length :int = -1) :void + public function readBytes ( + bytes :ByteArray, offset :uint = 0, length :uint = uint.MAX_VALUE) :void //throws IOError { // if no length specified then fill the ByteArray - if (length == -1) { + if (length == uint.MAX_VALUE) { length = bytes.length - offset; } // And, if we really want to read 0 bytes then just don't do anything, because an diff --git a/src/as/com/threerings/io/ObjectOutputStream.as b/src/as/com/threerings/io/ObjectOutputStream.as index 0901c01b7..a43255cf2 100644 --- a/src/as/com/threerings/io/ObjectOutputStream.as +++ b/src/as/com/threerings/io/ObjectOutputStream.as @@ -164,10 +164,11 @@ public class ObjectOutputStream _targ.writeByte(value); } - public function writeBytes (bytes :ByteArray, offset :int = 0, length :int = -1) :void + public function writeBytes ( + bytes :ByteArray, offset :uint = 0, length :uint = uint.MAX_VALUE) :void //throws IOError { - if (length == -1) { + if (length == uint.MAX_VALUE) { length = bytes.length - offset; } if (length > 0) {