public static long getLongLittleEndian ( final byte [ ] buf , final int offset ) { return ( ( long ) buf [ offset + 7 ] << 56 ) // no mask needed | ( ( buf [ offset + 6 ] & 0xff L ) << 48 ) | ( ( buf [ offset + 5 ] & 0xff L ) << 40 ) | ( ( buf [ offset + 4 ] & 0xff L ) << 32 ) | ( ( buf [ offset + 3 ] & 0xff L ) << 24 ) | ( ( buf [ offset + 2 ] & 0xff L ) << 16 ) | ( ( buf [ offset + 1 ] & 0xff L ) << 8 ) | ( ( buf [ offset ] & 0xff L ) ) ; // no shift needed }
Gets a long from a byte buffer in little endian byte order .