public static long bytesToLong(final byte[] bytes){
  final ByteBuffer buffer=ByteBuffer.allocate(8);
  buffer.put(bytes,0,8);
  buffer.flip();
  return buffer.getLong();
}

public static long bytesToLong ( final byte [ ] bytes ) { final ByteBuffer buffer = ByteBuffer . allocate ( 8 ) ; buffer . put ( bytes , 0 , 8 ) ; buffer . flip ( ) ; return buffer . getLong ( ) ; }
converts an array of 8 bytes into a long .
