@Test (expectedExceptions = IndexOutOfBoundsException.class) public void bytesToLongTooShort() throws Exception { Utils.bytesToLong(new byte[] { 0, 0, 0, 0, 0, 0, 0 }); }
public static long bytesToLong(final byte[] bytes) { return (bytes[0] & 0xFFL) << 56 | (bytes[1] & 0xFFL) << 48 | (bytes[2] & 0xFFL) << 40 | (bytes[3] & 0xFFL) << 32 | (bytes[4] & 0xFFL) << 24 | (bytes[5] & 0xFFL) << 16 | (bytes[6] & 0xFFL) << 8 | (bytes[7] & 0xFFL) << 0; }
Utils { public static long bytesToLong(final byte[] bytes) { return (bytes[0] & 0xFFL) << 56 | (bytes[1] & 0xFFL) << 48 | (bytes[2] & 0xFFL) << 40 | (bytes[3] & 0xFFL) << 32 | (bytes[4] & 0xFFL) << 24 | (bytes[5] & 0xFFL) << 16 | (bytes[6] & 0xFFL) << 8 | (bytes[7] & 0xFFL) << 0; } }
Utils { public static long bytesToLong(final byte[] bytes) { return (bytes[0] & 0xFFL) << 56 | (bytes[1] & 0xFFL) << 48 | (bytes[2] & 0xFFL) << 40 | (bytes[3] & 0xFFL) << 32 | (bytes[4] & 0xFFL) << 24 | (bytes[5] & 0xFFL) << 16 | (bytes[6] & 0xFFL) << 8 | (bytes[7] & 0xFFL) << 0; } private  Utils(); }
Utils { public static long bytesToLong(final byte[] bytes) { return (bytes[0] & 0xFFL) << 56 | (bytes[1] & 0xFFL) << 48 | (bytes[2] & 0xFFL) << 40 | (bytes[3] & 0xFFL) << 32 | (bytes[4] & 0xFFL) << 24 | (bytes[5] & 0xFFL) << 16 | (bytes[6] & 0xFFL) << 8 | (bytes[7] & 0xFFL) << 0; } private  Utils(); static long hash(long val); static long fnvhash64(long val); static long bytesToLong(final byte[] bytes); static byte[] longToBytes(final long val); static double bytesToDouble(final byte[] bytes); static byte[] doubleToBytes(final double val); static int getActiveThreadCount(); static long getUsedMemoryBytes(); static int getUsedMemoryMegaBytes(); static double getSystemLoadAverage(); static long getGCTotalCollectionCount(); static long getGCTotalTime(); static Map<String, Long[]> getGCStatst(); static T [] shuffleArray(final T[] array); }
Utils { public static long bytesToLong(final byte[] bytes) { return (bytes[0] & 0xFFL) << 56 | (bytes[1] & 0xFFL) << 48 | (bytes[2] & 0xFFL) << 40 | (bytes[3] & 0xFFL) << 32 | (bytes[4] & 0xFFL) << 24 | (bytes[5] & 0xFFL) << 16 | (bytes[6] & 0xFFL) << 8 | (bytes[7] & 0xFFL) << 0; } private  Utils(); static long hash(long val); static long fnvhash64(long val); static long bytesToLong(final byte[] bytes); static byte[] longToBytes(final long val); static double bytesToDouble(final byte[] bytes); static byte[] doubleToBytes(final double val); static int getActiveThreadCount(); static long getUsedMemoryBytes(); static int getUsedMemoryMegaBytes(); static double getSystemLoadAverage(); static long getGCTotalCollectionCount(); static long getGCTotalTime(); static Map<String, Long[]> getGCStatst(); static T [] shuffleArray(final T[] array); static final long FNV_OFFSET_BASIS_64; static final long FNV_PRIME_64; }