close resource
This commit is contained in:
parent
95575756ee
commit
06898f47b2
1 changed files with 5 additions and 4 deletions
|
@ -208,11 +208,12 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader {
|
||||||
con.setDoOutput(true);
|
con.setDoOutput(true);
|
||||||
con.getOutputStream().write(postDataBytes);
|
con.getOutputStream().write(postDataBytes);
|
||||||
|
|
||||||
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
String inputLine;
|
try (BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()))) {
|
||||||
while ((inputLine = in.readLine()) != null) {
|
String inputLine;
|
||||||
sb.append(inputLine);
|
while ((inputLine = in.readLine()) != null) {
|
||||||
|
sb.append(inputLine);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return new DownloadResponse(sb.toString(), con.getHeaderFields());
|
return new DownloadResponse(sb.toString(), con.getHeaderFields());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue