Here you can find the source of toLong(byte[] buf)
static long toLong(byte[] buf)
//package com.java2s; //License from project: Apache License public class Main { static long toLong(byte[] buf) { int n = 0; for (byte b : buf) { n = (n << 8) + (b & 0xff); }/*from w w w. j a v a 2 s .co m*/ return n; } }