//flash 读取8字节64位数据
public static function readInt64(bytes:ByteArray):Number{
var _a:uint = bytes.readUnsignedInt();
var _b:Number = bytes.readUnsignedInt();
var ta:int = _a & 0x7FFFFFFF;
if(0 != uint(0x80000000 & _a)){
return (0x100000000 * ta + _b)*-1;
}
return 0x100000000 * ta + _b;
}
//flash 写入字节流8字节64位数据
public static function writeInt64(value:Number,bytes:ByteArray):void {
var aa:Number = value;
if(0 > value){
aa *= -1;
}
var b:uint = aa % 0x100000000;
var a:uint = (aa - b) / 0x100000000;
if(0 > value){
a |= 0x80000000;
}
bytes.writeUnsignedInt(a);
bytes.writeUnsignedInt(b);
}