use Bytes#getInt32 and BytesBuffer#addInt32

fix test for python and php targets
This commit is contained in:
Andy Li
2018-05-11 11:00:40 +08:00
parent 4eb84e5c32
commit aae5f431cb
+2 -5
View File
@@ -72,10 +72,7 @@ class Bytes {
}
function doEncodeInt(v: Int) {
bout.addByte(v & 0xFF);
bout.addByte((v >> 8) & 0xFF);
bout.addByte((v >> 16) & 0xFF);
bout.addByte(v >>> 24);
bout.addInt32(v);
}
function doEncodeConst( c : Const ) {
@@ -107,7 +104,7 @@ class Bytes {
}
function doDecodeInt() {
var i = bin.get(pin) | (bin.get(pin+1) << 8) | (bin.get(pin+2) << 16) | (bin.get(pin+3) << 24);
var i = bin.getInt32(pin);
pin += 4;
return i;
}