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
This commit is contained in:
@@ -202,11 +202,12 @@ public class ObjectInputStream
|
|||||||
* Read bytes into the byte array. If length is not specified, then
|
* Read bytes into the byte array. If length is not specified, then
|
||||||
* enough bytes to fill the array (from the offset) are read.
|
* 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
|
//throws IOError
|
||||||
{
|
{
|
||||||
// if no length specified then fill the ByteArray
|
// if no length specified then fill the ByteArray
|
||||||
if (length == -1) {
|
if (length == uint.MAX_VALUE) {
|
||||||
length = bytes.length - offset;
|
length = bytes.length - offset;
|
||||||
}
|
}
|
||||||
// And, if we really want to read 0 bytes then just don't do anything, because an
|
// And, if we really want to read 0 bytes then just don't do anything, because an
|
||||||
|
|||||||
@@ -164,10 +164,11 @@ public class ObjectOutputStream
|
|||||||
_targ.writeByte(value);
|
_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
|
//throws IOError
|
||||||
{
|
{
|
||||||
if (length == -1) {
|
if (length == uint.MAX_VALUE) {
|
||||||
length = bytes.length - offset;
|
length = bytes.length - offset;
|
||||||
}
|
}
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user