I have a byte[5] array which represents a decimal number when printed as a hex string. Two digits can be stored in one byte, the hex characters are not used. E.g.
[0x11,0x45,0x34,0x31,0x21] -> 1145343121.
Is there a more efficient way in Java (some bitshifting magic maybe) to do the conversion to a decimal number other than
long result = Long.parseLong(byteToHexString(bytes[]));?
An efficient conversion vice versa would also be interesting...