Here you can find the source of getUIntByByteArray(byte[] data, boolean isLH)
public static long getUIntByByteArray(byte[] data, boolean isLH)
//package com.java2s; public class Main { public static long getUIntByByteArray(byte[] data, boolean isLH) { long result = 0; for (int i = 0; i < data.length; i++) { byte b = data[i]; int t = getUIntByByte(b); result += t << ((isLH ? i : data.length - i - 1) * 8); }/* w w w . j av a 2 s . c om*/ return result; } /** * new byte[] { 8, 4, 2, 1 } => 00000001 00000010 00000100 00001000 * * @param data * @return */ public static long getUIntByByteArray(byte[] data) { return getUIntByByteArray(data, true); } /** * new byte[] { 8, 4, 2, 1 } => 00000001 00000010 00000100 00001000 * * @param data * @return */ public static int getUIntByByte(byte data) { return data & 0xFF; } }