Code example for JsonReader

0
    protected JsonReader fetchJson(HttpsURLConnection connection) throws IOException {
        int resp = connection.getResponseCode();
        System.err.println("Response code: " + resp);
 
        InputStream s = connection.getInputStream();
        return new JsonReader(new InputStreamReader(s));
    } 
 
    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    List<Job> getJobs(int limit) throws IOException {
        List<Job> jobs = new LinkedList<Job>();
        String args = "full=true";
 
        if (limit > 0) {
            args += "&limit=" + limit;
        } 
 
        HttpsURLConnection conn = this.buildConnection("GET", this.handle + "/jobs", args);
        JsonReader reader = this.fetchJson(conn);
 
Experience pair programming with AI  Get Codota for Java