Here you can find the source of intFromBytes(byte[] bytes, int offset)
public static int intFromBytes(byte[] bytes, int offset)
//package com.java2s; /*//from w w w . j a v a 2 s .c om * JaamSim Discrete Event Simulation * Copyright (C) 2013 Ausenco Engineering Canada Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ public class Main { public static int intFromBytes(byte[] bytes, int offset) { int ret = 0; ret |= (bytes[offset + 0] & 0xFF) << 24; ret |= (bytes[offset + 1] & 0xFF) << 16; ret |= (bytes[offset + 2] & 0xFF) << 8; ret |= bytes[offset + 3] & 0xFF; return ret; } }