I have a byte[4] which contains a 32-bit unsigned integer (in big endian order) and I need to convert it to long (as int can\'t hold an unsigned number).
You can use ByteBuffer, or you can do it the old-fashioned way:
long result = 0x00FF & byteData[0];
result <<= 8;
result += 0x00FF & byteData[1];
result <<= 8;
result += 0x00FF & byteData[2];
result <<= 8;
result += 0x00FF & byteData[3];