Java tutorial
//package com.java2s; //License from project: Apache License import org.json.JSONArray; import org.json.JSONException; import java.util.ArrayList; import java.util.List; public class Main { public static List<Long> parseLongJsonList(JSONArray array) throws JSONException { if (array == null) { return new ArrayList<Long>(); } int size = array.length(); ArrayList<Long> list = new ArrayList<Long>(size); for (int i = 0; i < size; i++) { list.add(array.getLong(i)); } return list; } }