Here you can find the source of bytes2long(byte[] b)
public static long bytes2long(byte[] b)
//package com.java2s; //License from project: Apache License public class Main { public static long bytes2long(byte[] b) { int mask = 0xff; int temp = 0; int res = 0; for (int i = 0; i < 8; i++) { res <<= 8;//from w ww . java 2s .co m temp = b[i] & mask; res |= temp; } return res; } }