Here you can find the source of longFromByteArray(final byte[] buf, final int offset)
public static final long longFromByteArray(final byte[] buf, final int offset)
//package com.java2s; //License from project: Apache License public class Main { public static final long longFromByteArray(final byte[] buf, final int offset) { long v = 0; v |= ((((long) buf[offset + 0]) & 0xFF) << 56); v |= ((((long) buf[offset + 1]) & 0xFF) << 48); v |= ((((long) buf[offset + 2]) & 0xFF) << 40); v |= ((((long) buf[offset + 3]) & 0xFF) << 32); v |= ((((long) buf[offset + 4]) & 0xFF) << 24); v |= ((((long) buf[offset + 5]) & 0xFF) << 16); v |= ((((long) buf[offset + 6]) & 0xFF) << 8); v |= ((((long) buf[offset + 7]) & 0xFF) << 0); return v; }// ww w .j av a 2 s . c o m }