Here you can find the source of toIntArray(JsonArray jsonArray)
public static int[] toIntArray(JsonArray jsonArray)
//package com.java2s; //License from project: Open Source License import javax.json.JsonArray; import javax.json.JsonNumber; public class Main { public static int[] toIntArray(JsonArray jsonArray) { if (jsonArray == null) return new int[0]; int[] ret = new int[jsonArray.size()]; for (int i = 0; i < jsonArray.size(); i++) { ret[i] = ((JsonNumber) jsonArray.get(i)).intValue(); }//w w w .j a va2 s . c o m return ret; } }