Fast method to convert List of Integers to int Array in Java

Viewed 32

What is the fast method for converting List<Integer> to int[] array, rather than using mapToInt()

List<Integer> list = new ArrayList<>(Arrays.asList(1,2,3));
list.stream().mapToInt(i->i.intValue()).toArray();
0 Answers
Related