Here you can find the source of toLongArray(List
public static long[] toLongArray(List<Integer> list)
//package com.java2s; //License from project: Open Source License import java.util.Iterator; import java.util.List; public class Main { public static long[] toLongArray(List<Integer> list) { long[] array = new long[list.size()]; Iterator<Integer> ints = list.iterator(); int idx = 0; while (ints.hasNext()) { Integer value = ints.next(); array[idx++] = value.intValue(); }/*from www .ja v a 2s . c o m*/ return array; } }