The following example shows converting a Byte array to Long.
First create a ByteBuffer with given byte array and then read next 8 bytes from it as a Long.
java.nio.ByteBuffer
public static ByteBuffer wrap(byte[] array) Wraps a byte array into a buffer.
public long getLong() Reads the next eight bytes in the ByteBuffer as a Long.