Here you can find the source of toLongArray(final byte[] array)
public static long[] toLongArray(final byte[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static long[] toLongArray(final byte[] array) { return toLongArray(array, 0, array.length); }//from w w w.j a v a 2s. co m public static long[] toLongArray(final byte[] array, final int off, final int len) { return toLongArray(array, off, len, new long[len], 0); } public static long[] toLongArray(final byte[] from, final int fromOff, final int len, final long[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static long[] toLongArray(final char[] array) { return toLongArray(array, 0, array.length); } public static long[] toLongArray(final char[] array, final int off, final int len) { return toLongArray(array, off, len, new long[len], 0); } public static long[] toLongArray(final char[] from, final int fromOff, final int len, final long[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static long[] toLongArray(final short[] array) { return toLongArray(array, 0, array.length); } public static long[] toLongArray(final short[] array, final int off, final int len) { return toLongArray(array, off, len, new long[len], 0); } public static long[] toLongArray(final short[] from, final int fromOff, final int len, final long[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static long[] toLongArray(final int[] array) { return toLongArray(array, 0, array.length); } public static long[] toLongArray(final int[] array, final int off, final int len) { return toLongArray(array, off, len, new long[len], 0); } public static long[] toLongArray(final int[] from, final int fromOff, final int len, final long[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static long[] toLongArray(final float[] array) { return toLongArray(array, 0, array.length); } public static long[] toLongArray(final float[] array, final int off, final int len) { return toLongArray(array, off, len, new long[len], 0); } public static long[] toLongArray(final float[] from, final int fromOff, final int len, final long[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = (long) from[i]; } return to; } public static long[] toLongArray(final double[] array) { return toLongArray(array, 0, array.length); } public static long[] toLongArray(final double[] array, final int off, final int len) { return toLongArray(array, off, len, new long[len], 0); } public static long[] toLongArray(final double[] from, final int fromOff, final int len, final long[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = (long) from[i]; } return to; } }