Here you can find the source of toLongArray(List
Parameter | Description |
---|---|
list | The list to convert |
public static long[] toLongArray(List<Long> list)
//package com.java2s; import java.util.List; public class Main { /**//from www.java 2 s. com * This converts a list to it's primitive state. * In this case, it converts a {@link Long} list to a * long array. * * @param list The list to convert * @return The primitive array instance of the list's contents. */ public static long[] toLongArray(List<Long> list) { long[] array = new long[list.size()]; for (int i = 0; i < list.size(); i++) { array[i] = list.get(i); } return array; } public static long[] toLongArray(long... arr) { return arr; } }