List of usage examples for io.netty.util.internal PlatformDependent getLong
public static long getLong(byte[] data, int index)
From source file:herddb.utils.Bytes.java
License:Apache License
public static long toLong(byte[] array, int index) { if (HAS_UNSAFE && UNALIGNED) { long v = PlatformDependent.getLong(array, index); return BIG_ENDIAN_NATIVE_ORDER ? v : Long.reverseBytes(v); }//from w w w . ja va2 s . c o m return ((long) array[index] & 0xff) << 56 | // ((long) array[index + 1] & 0xff) << 48 | // ((long) array[index + 2] & 0xff) << 40 | // ((long) array[index + 3] & 0xff) << 32 | // ((long) array[index + 4] & 0xff) << 24 | // ((long) array[index + 5] & 0xff) << 16 | // ((long) array[index + 6] & 0xff) << 8 | // (long) array[index + 7] & 0xff; }
From source file:org.apache.bookkeeper.bookie.storage.ldb.ArrayUtil.java
License:Apache License
public static long getLong(byte[] array, int index) { if (HAS_UNSAFE && UNALIGNED) { long v = PlatformDependent.getLong(array, index); return BIG_ENDIAN_NATIVE_ORDER ? v : Long.reverseBytes(v); }//w w w. j ava2s . com return ((long) array[index] & 0xff) << 56 | // ((long) array[index + 1] & 0xff) << 48 | // ((long) array[index + 2] & 0xff) << 40 | // ((long) array[index + 3] & 0xff) << 32 | // ((long) array[index + 4] & 0xff) << 24 | // ((long) array[index + 5] & 0xff) << 16 | // ((long) array[index + 6] & 0xff) << 8 | // (long) array[index + 7] & 0xff; }