Here you can find the source of toIntArray(final byte[] array)
public static int[] toIntArray(final byte[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static int[] toIntArray(final byte[] array) { return toIntArray(array, 0, array.length); }//w w w . ja va2 s. c o m public static int[] toIntArray(final byte[] array, final int off, final int len) { return toIntArray(array, off, len, new int[len], 0); } public static int[] toIntArray(final byte[] from, final int fromOff, final int len, final int[] 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 int[] toIntArray(final char[] array) { return toIntArray(array, 0, array.length); } public static int[] toIntArray(final char[] array, final int off, final int len) { return toIntArray(array, off, len, new int[len], 0); } public static int[] toIntArray(final char[] from, final int fromOff, final int len, final int[] 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 int[] toIntArray(final short[] array) { return toIntArray(array, 0, array.length); } public static int[] toIntArray(final short[] array, final int off, final int len) { return toIntArray(array, off, len, new int[len], 0); } public static int[] toIntArray(final short[] from, final int fromOff, final int len, final int[] 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 int[] toIntArray(final long[] array) { return toIntArray(array, 0, array.length); } public static int[] toIntArray(final long[] array, final int off, final int len) { return toIntArray(array, off, len, new int[len], 0); } public static int[] toIntArray(final long[] from, final int fromOff, final int len, final int[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = (int) from[i]; } return to; } public static int[] toIntArray(final float[] array) { return toIntArray(array, 0, array.length); } public static int[] toIntArray(final float[] array, final int off, final int len) { return toIntArray(array, off, len, new int[len], 0); } public static int[] toIntArray(final float[] from, final int fromOff, final int len, final int[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = (int) from[i]; } return to; } public static int[] toIntArray(final double[] array) { return toIntArray(array, 0, array.length); } public static int[] toIntArray(final double[] array, final int off, final int len) { return toIntArray(array, off, len, new int[len], 0); } public static int[] toIntArray(final double[] from, final int fromOff, final int len, final int[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = (int) from[i]; } return to; } }