Here you can find the source of byteToLong(byte[] buf, int off)
public static long byteToLong(byte[] buf, int off)
//package com.java2s; //License from project: Open Source License public class Main { public static long byteToLong(byte[] buf, int off) { return (((long) buf[off + 0] << 56) + ((long) (buf[off + 1] & 255) << 48) + ((long) (buf[off + 2] & 255) << 40) + ((long) (buf[off + 3] & 255) << 32) + ((long) (buf[off + 4] & 255) << 24) + ((buf[off + 5] & 255) << 16) + ((buf[off + 6] & 255) << 8) + ((buf[off + 7] & 255) << 0)); }//from ww w . j a v a2 s . co m }