I have these byte arrays:

I have to order to little endian before to convert.
In first case, I do the conversion easyly:
byte[] serial = {-91, -101, 62, 55};
int serialNumber = java.nio.ByteBuffer.wrap(serial).order(ByteOrder.LITTLE_ENDIAN).getInt();
//serialNumber == 926849957 //Nice, works!!!!
In second case, the conversion doesn't works:
byte[] serial = {-45, 12, 115, -28};
int serialNumber = java.nio.ByteBuffer.wrap(serial).order(ByteOrder.LITTLE_ENDIAN).getInt();
//serialNumber == -462222125 //Wrong conversion. The right answer is 3832745171.
The number 3832745171 is larger than Integer.MAX_VALUE, but if I try to convert to long I got a problem too.
How can I do this? Thanks.
Try to convert byte arrays to int/long types.