Here you can find the source of getJsonIntArray(Iterable
public static JsonArray getJsonIntArray(Iterable<Integer> integers)
//package com.java2s; //License from project: Apache License import javax.json.Json; import javax.json.JsonArray; import javax.json.JsonArrayBuilder; public class Main { public static JsonArray getJsonIntArray(Iterable<Integer> integers) { JsonArrayBuilder builder = Json.createArrayBuilder(); for (int i : integers) { builder.add(i);/*from ww w.j av a 2 s . c o m*/ } return builder.build(); } }