Here you can find the source of toLong(byte[] b)
public static long toLong(byte[] b)
//package com.java2s; //License from project: Apache License public class Main { public static long toLong(byte[] b) { return toLong(b, 0); }//from www . j a v a 2s . c o m public static long toLong(byte[] b, int off) { return ((b[off + 7] & 0xFFL) << 0) + ((b[off + 6] & 0xFFL) << 8) + ((b[off + 5] & 0xFFL) << 0x10) + ((b[off + 4] & 0xFFL) << 0x18) + ((b[off + 3] & 0xFFL) << 0x20) + ((b[off + 2] & 0xFFL) << 0x28) + ((b[off + 1] & 0xFFL) << 0x30) + ((b[off + 0] & 0xFFL) << 0x38); } }