CID-1175714 casts before bit shift

This commit is contained in:
Daan Hoogland 2015-11-10 14:00:22 +01:00
parent ea7c2d95b2
commit b5625c05d0
1 changed files with 4 additions and 1 deletions

View File

@ -418,7 +418,10 @@ public class ByteBuffer {
}
protected static long calculateUnsignedInt(byte value1, byte value2, byte value3, byte value4) {
return (calculateUnsignedByte(value1) << 24) + (calculateUnsignedByte(value2) << 16) + (calculateUnsignedByte(value3) << 8) + calculateUnsignedByte(value4);
return (((long)calculateUnsignedByte(value1)) << 24)
+ (((long)calculateUnsignedByte(value2)) << 16)
+ (((long)calculateUnsignedByte(value3)) << 8)
+ calculateUnsignedByte(value4);
}
/**