Here you can find the source of toInt(T[] v)
public static <T> int[] toInt(T[] v)
//package com.java2s; //License from project: Apache License public class Main { public static <T> int[] toInt(T[] v) { if (v == null) return null; int[] newv = new int[v.length]; for (int i = 0; i < v.length; i++) newv[i] = ((Integer) v[i]); return newv; }//from w w w.j a va2 s . com public static int[] toInt(boolean[] v) { int[] newv = new int[v.length]; for (int i = 0; i < v.length; i++) newv[i] = v[i] ? 1 : 0; return newv; } }