Here you can find the source of toInt(byte[] b)
public static int toInt(byte[] b)
//package com.java2s; /**//from www . j a v a2 s . co m * @(#)ByteUtils.java, 2013-2-24. * * Copyright 2013 Netease, Inc. All rights reserved. * NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ public class Main { public static int toInt(byte[] b) { return (((((int) b[3]) & 0xFF)) | ((((int) b[2]) & 0xFF) << 8) | ((((int) b[1]) & 0xFF) << 16) | ((((int) b[0]) & 0xFF) << 24)); } public static int toInt(byte[] b, int offset) { return (((((int) b[3 + offset]) & 0xFF)) | ((((int) b[2 + offset]) & 0xFF) << 8) | ((((int) b[1 + offset]) & 0xFF) << 16) | ((((int) b[offset]) & 0xFF) << 24)); } }