I have a fragment of bytes in a byte[]. The total size of the array is 4 and I want to convert this into a positive long number. For example if the byte array is having four bytes 101, 110, 10, 10000001 then i want to get the long number represented by binary sequence
00000000 00000000 00000000 00000000 00000101 00000110 00000010 10000001
which equals 84279937
What is the efficient way to do that in Java?