public static long convertBytesToLong ( byte [ ] bytes , int offset ) { long value = 0 ; for ( int i = offset ; i < offset + 8 ; i ++ ) { byte b = bytes [ i ] ; value <<= 8 ; value |= b ; } return value ; }
Utility method to convert an array of bytes into a long . Byte ordered is assumed to be big - endian .