Here you can find the source of bytesToInt(byte A, byte B, byte C, byte D)
public static int bytesToInt(byte A, byte B, byte C, byte D)
//package com.java2s; //License from project: Open Source License public class Main { public static final short MASK_TO_BYTE = 0xFF; public static int bytesToInt(byte A, byte B, byte C, byte D) { int i = (D & MASK_TO_BYTE); i |= ((C & MASK_TO_BYTE) << 8); i |= ((B & MASK_TO_BYTE) << 16); i |= ((A & MASK_TO_BYTE) << 24); return i; }//from ww w .j ava2 s .co m public static int bytesToInt(byte[] bytes) { return bytesToInt(bytes[0], bytes[1], bytes[2], bytes[3]); } }