Here you can find the source of byteToInt(final byte[] b)
Parameter | Description |
---|---|
b | Byte array to convert |
public static int byteToInt(final byte[] b)
//package com.java2s; public class Main { /**/* w ww .j a v a2s .com*/ * Converts a given byte array to an integer value * * @param b * Byte array to convert * @return Integer value */ public static int byteToInt(final byte[] b) { int result = 0; for (int j = 0; j < 4; j++) { result <<= 8; result |= (b[j] & 0xFF); } return result; } }