Here you can find the source of byte2int(final byte[] arr)
Parameter | Description |
---|---|
arr | byte[4] |
public static int byte2int(final byte[] arr)
//package com.java2s; public class Main { /**// w w w . ja v a 2 s. co m * Convert int to byte[4] * * @param arr * byte[4] * @return int */ public static int byte2int(final byte[] arr) { int res = arr[3] & 0xff; res = (res << 8) | (arr[2] & 0xff); res = (res << 8) | (arr[1] & 0xff); res = (res << 8) | (arr[0] & 0xff); return res; } }