I want to safely, fully close multiple streams using Java's try-with-resources. I don't know how verbose I have to be. I want to make sure my resources are fully disposed of. My code works like this:

```
JSONObject json;

URL url = new URL("http://example.com/api.json");
HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
urlConn.setRequestMethod("GET");
urlConn.connect();
try (InputStream is = urlConn.getInputStream()) {
    try (InputStreamReader isr = new InputStreamReader(is)) {
        StringBuilder sb = new StringBuilder();
        try (BufferedReader reader = new BufferedReader(isr)) {
            String inputStr;
            while ((inputStr = reader.readLine()) != null)
                sb.append(inputStr);

            json = new JSONObject(sb.toString());
        }
    }
}

```

I'm wondering if this is overkill, and if I can do this:

```
//...
urlConn.connect();

StringBuilder sb = new StringBuilder();
try (BufferedReader reader = new BufferedReader(
        new InputStreamReader(urlConn.getInputStream()))) {
    String inputStr;
    while ((inputStr = reader.readLine()) != null)
        sb.append(inputStr);

    json = new JSONObject(sb.toString());
}

```