Here you can find the source of unsigned4BytesToInt(byte[] buf, int pos)
public static long unsigned4BytesToInt(byte[] buf, int pos)
//package com.java2s; public class Main { public static long unsigned4BytesToInt(byte[] buf, int pos) { int firstByte = 0; int secondByte = 0; int thirdByte = 0; int fourthByte = 0; int index = pos; firstByte = (0x000000FF & ((int) buf[index])); secondByte = (0x000000FF & ((int) buf[index + 1])); thirdByte = (0x000000FF & ((int) buf[index + 2])); fourthByte = (0x000000FF & ((int) buf[index + 3])); index = index + 4;// www.j av a 2 s.c o m return ((long) (firstByte << 24 | secondByte << 16 | thirdByte << 8 | fourthByte)) & 0xFFFFFFFFL; } }