Here you can find the source of bytesToInt(byte[] b)
Parameter | Description |
---|---|
b | byte array to convert |
public static int bytesToInt(byte[] b)
//package com.java2s; // it under the terms of the GNU Lesser General Public License as published public class Main { /**/*from w w w. jav a 2s. c o m*/ * Converts a byte array to a representative int * @param b byte array to convert * @return representative int */ public static int bytesToInt(byte[] b) { return ((b[0] << 24) & 0xff000000) | ((b[1] << 16) & 0xff0000) | ((b[2] << 8) & 0xff00) | (b[3] & 0xff); } }