Here you can find the source of bytesToLong(byte[] bytes, int start)
public static long bytesToLong(byte[] bytes, int start)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { private static final int LONG_BYTES = Long.SIZE / 8; private static final ByteBuffer LONG_BUFFER = ByteBuffer .allocate(LONG_BYTES);//from w ww .j a v a 2 s. c o m public static long bytesToLong(byte[] bytes, int start) { LONG_BUFFER.position(0); LONG_BUFFER.put(bytes, start, LONG_BYTES); LONG_BUFFER.flip(); return LONG_BUFFER.getLong(0); } }