Here you can find the source of toLong(byte[] in)
public static long toLong(byte[] in)
//package com.java2s; //License from project: Open Source License public class Main { public static long toLong(byte[] in) { return (((toInt(in[0], in[1], in[2], in[3]))) | ((long) (toInt(in[4], in[5], in[6], in[7])) << (long) 32)); }/*from w ww .j av a2 s. com*/ public static int toInt(byte in0, byte in1, byte in2, byte in3) { return (in0 & 0xFF) | ((in1 & 0xFF) << 8) | ((in2 & 0xFF) << 16) | ((in3 & 0xFF) << 24); } public static int toInt(byte[] in) { return toInt(in[0], in[1], in[2], in[3]); } public static int toInt(byte[] in, int ofs) { return toInt(in[ofs + 0], in[ofs + 1], in[ofs + 2], in[ofs + 3]); } }