Here you can find the source of convertLongFromBytes(byte[] bytes)
public static long convertLongFromBytes(byte[] bytes)
//package com.java2s; public class Main { public static long convertLongFromBytes(byte[] bytes) { return convertLongFromBytes(bytes, 0); }/*w w w . j a v a2 s .co m*/ public static long convertLongFromBytes(byte[] bytes, int offset) { // Convert it to an long return ((((long) bytes[offset + 7]) & 0xFF) + ((((long) bytes[offset + 6]) & 0xFF) << 8) + ((((long) bytes[offset + 5]) & 0xFF) << 16) + ((((long) bytes[offset + 4]) & 0xFF) << 24) + ((((long) bytes[offset + 3]) & 0xFF) << 32) + ((((long) bytes[offset + 2]) & 0xFF) << 40) + ((((long) bytes[offset + 1]) & 0xFF) << 48) + ((((long) bytes[offset + 0]) & 0xFF) << 56)); } }