Transforms any array into an array of {@code long}.
@param src source array
@param srcPos start position
@param len length
@return long array
507397
public static long[] unboxLongs(Object src, int srcPos, int len) {
        return unboxLongs(array(src), srcPos, len);
    }
1290772
public static final long toLong(byte[] b) {
        long x = 0;
        for (int i = b.length; i > 0; x |= (b[--i] & 0xffL) << (i << 3));
        return x;
    }
992565
private long[] calcBucketOffset(long timestampMs) {
        long bucketOffset = toTimeSeriesPoint(timestampMs);
        long delta = bucketOffset % (RESOLUTION_MS * BUCKET_SIZE);
        long bucketId = bucketOffset - delta;
        return new long[] { bucketId, bucketOffset };
    }
162499
public static Long[] wrap(long... values) {
		if (null == values) {
			return null;
		}
		final int length = values.length;
		if (0 == length) {
			return new Long[0];
		}

		final Long[] array = new Long[length];
		for (int i = 0; i < length; i++) {
			array[i] = Long.valueOf(values[i]);
		}
		return array;
	}
153280
public long getLong(final int index, final ByteOrder byteOrder)
    {
        boundsCheck0(index, SIZE_OF_LONG);

        long bits = UNSAFE.getLong(byteArray, ARRAY_BASE_OFFSET + index);
        if (NATIVE_BYTE_ORDER != byteOrder)
        {
            bits = Long.reverseBytes(bits);
        }

        return bits;
    }
621137
public long[] readLongs (int length) throws KryoException {
		long[] array = new long[length];
		if (optional(length << 3) == length << 3) {
			byte[] buffer = this.buffer;
			int p = this.position;
			for (int i = 0; i < length; i++, p += 8) {
				array[i] = buffer[p] & 0xFF //
					| (buffer[p + 1] & 0xFF) << 8 //
					| (buffer[p + 2] & 0xFF) << 16 //
					| (long)(buffer[p + 3] & 0xFF) << 24 //
					| (long)(buffer[p + 4] & 0xFF) << 32 //
					| (long)(buffer[p + 5] & 0xFF) << 40 //
					| (long)(buffer[p + 6] & 0xFF) << 48 //
					| (long)buffer[p + 7] << 56;
			}
			position = p;
		} else {
			for (int i = 0; i < length; i++)
				array[i] = readLong();
		}
		return array;
	}
1142758
private Date[] convertLongArrayToDateArray(final Long[] source) {

		final ArrayList<Date> result = new ArrayList<>();

		for (final Long o : source) {
			
			result.add(new Date(o));
		}

		return (Date[])result.toArray(new Date[result.size()]);
	}
1147078
public static Object[] boxAll(Class<?> type, Object src, int srcPos, int len) {
        switch (tId(type)) {
            case I_BOOLEAN:     return boxBooleans(src, srcPos, len);
            case I_BYTE:        return boxBytes(src, srcPos, len);
            case I_CHARACTER:   return boxCharacters(src, srcPos, len);
            case I_DOUBLE:      return boxDoubles(src, srcPos, len);
            case I_FLOAT:       return boxFloats(src, srcPos, len);
            case I_INTEGER:     return boxIntegers(src, srcPos, len);
            case I_LONG:        return boxLongs(src, srcPos, len);
            case I_SHORT:       return boxShorts(src, srcPos, len);
        }
        throw new IllegalArgumentException("No primitive/box: " + type);
    }
1344874
public static Double[] boxDoubles(Object src, int srcPos, int len) {
        return boxDoubles(array(src), srcPos, len);
    }
1177167
private static void putLong(byte[] array, long l, int pos, int numberOfLongBytes) {
    for (int i = 0; i < numberOfLongBytes; ++i) {
      array[pos + numberOfLongBytes - i - 1] = (byte) (l >>> (i * 8));
    }
  }
1261095
public static int[] flip(int[] src, int[] dest, final int start, final int length)
	{
		if (dest == null || dest.length < length)
			dest = new int[length];

		int srcIndex = start + length;
		for (int i = 0; i < length; i++)
		{
			dest[i] = src[--srcIndex];
		}

		return dest;
	}
20009
public static Float[] boxFloats(Object src, int srcPos, int len) {
        return boxFloats(array(src), srcPos, len);
    }
793861
public static Boolean[] boxBooleans(Object src, int srcPos, int len) {
        return boxBooleans(array(src), srcPos, len);
    }
697145
public static long getLongLE(final byte[] array, final int offset) {
    return  ( array[offset    ] & 0XFFL       )
          | ((array[offset + 1] & 0XFFL) <<  8)
          | ((array[offset + 2] & 0XFFL) << 16)
          | ((array[offset + 3] & 0XFFL) << 24)
          | ((array[offset + 4] & 0XFFL) << 32)
          | ((array[offset + 5] & 0XFFL) << 40)
          | ((array[offset + 6] & 0XFFL) << 48)
          | ((array[offset + 7] & 0XFFL) << 56);
  }
855427
public static long[] toLongArray(String pString, String pDelimiters) {
        if (isEmpty(pString)) {
            return new long[0];
        }

        // Some room for improvement here...
        String[] temp = toStringArray(pString, pDelimiters);
        long[] array = new long[temp.length];

        for (int i = 0; i < array.length; i++) {
            array[i] = Long.parseLong(temp[i]);
        }
        return array;
    }
805344
static Long[] createLongs() {
        int len = LONG_UPPER_BOUND - LONG_LOWER_BOUND + 1;
        Long[] ret = new Long[len];
        long val = (long) LONG_LOWER_BOUND;
        for (int i = 0; i < len; i++, val++) {
            ret[i] = new Long(val);
        }
        return ret;
    }
872838
public static Object unboxAll(Object[] src, int srcPos, int len) {
        if (srcPos >= src.length) {
            throw new IndexOutOfBoundsException(String.valueOf(srcPos));
        }
        Class<?> type = src[srcPos].getClass();
        return unboxAll(type, src, srcPos, len);
    }