Here you can find the source of bytesToUint(byte first, byte second, byte third, byte fourth)
public static int bytesToUint(byte first, byte second, byte third, byte fourth)
//package com.java2s; //License from project: Apache License public class Main { public static int bytesToUint(byte first, byte second, byte third, byte fourth) { int firstI = (first & 0xFF) << 24; int secondI = (second & 0xFF) << 16; int thirdI = (third & 0xFF) << 8; int fourthI = (fourth & 0xFF); return firstI | secondI | thirdI | fourthI; }/* ww w .j ava 2 s. c om*/ }