public
function
getLong():
Number
{
var
h:
Number
=
this
.readUnsignedInt();
var
l:
Number
=
this
.readUnsignedInt();
var
num:
Number
=
0
;
switch
(
this
.endian){
case
Endian.BIG_ENDIAN:
num= h * Math.pow(
2
,
32
) + l;
break
;
case
Endian.LITTLE_ENDIAN:
num= l * Math.pow(
2
,
32
) + h;
break
;
}
return
num;
}
public
function
putLong(num:
Number
):
void
{
var
h:
Number
,l:
Number
;
if
(num<Math.pow(
2
,
32
)){
h =
0
;l=num;
}
else
{
h =
int
(num/Math.pow(
2
,
32
));
l = num - h*Math.pow(
2
,
32
);
}
switch
(
this
.endian){
case
Endian.BIG_ENDIAN:
this
.writeUnsignedInt(h);
this
.writeUnsignedInt(l);
break
;
case
Endian.LITTLE_ENDIAN:
this
.writeUnsignedInt(l);
this
.writeUnsignedInt(h);
break
;
}
}