Here you can find the source of toLongArray(final List
public static long[] toLongArray(final List<String> idList)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { public static long[] toLongArray(final List<String> idList) { if (null == idList || idList.isEmpty()) { return new long[0]; }/*from w w w . j av a 2s. c o m*/ long[] result = new long[idList.size()]; for (int i = 0; i < idList.size(); i++) { result[i] = Long.parseLong(idList.get(i)); } return result; } public static long[] toLongArray(String[] idList) { if (null == idList || idList.length == 0) { return new long[0]; } long[] result = new long[idList.length]; for (int i = 0; i < idList.length; i++) { result[i] = Long.parseLong(idList[i]); } return result; } }