Here you can find the source of toInt(long[] a)
public static final int[] toInt(long[] a)
//package com.java2s; //License from project: Apache License public class Main { public static final int[] toInt(long[] a) { int[] b = new int[a.length]; for (int i = 0; i < a.length; i++) { b[i] = (int) a[i]; }/*from w ww. ja v a2 s . c o m*/ return b; } public static final int[] toInt(double[] a) { int[] b = new int[a.length]; for (int i = 0; i < a.length; i++) { b[i] = (int) a[i]; } return b; } public static final int[] toInt(float[] a) { int[] b = new int[a.length]; for (int i = 0; i < a.length; i++) { b[i] = (int) a[i]; } return b; } public static final int[][] toInt(double[][] a) { int[][] b = new int[a.length][a[0].length]; for (int i = 0; i < a.length; i++) for (int j = 0; j < a[0].length; j++) { b[i][j] = (int) a[i][j]; } return b; } public static final int[][] toInt(float[][] a) { int[][] b = new int[a.length][a[0].length]; for (int i = 0; i < a.length; i++) for (int j = 0; j < a[0].length; j++) { b[i][j] = (int) a[i][j]; } return b; } public static final int[][][] toInt(boolean[][][] a) { int[][][] b = new int[a.length][a[0].length][a[0][0].length]; for (int i = 0; i < a.length; i++) for (int j = 0; j < a[0].length; j++) for (int k = 0; k < a[0][0].length; k++) { if (a[i][j][k]) b[i][j][k] = 1; } return b; } }