File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/main/java/io/doorbell/android/manavo/rest Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -258,16 +258,21 @@ private Bundle executeRequest(HttpRequest request) {
258258 Header contentEncoding = response .getFirstHeader ("Content-Encoding" );
259259 if (contentEncoding != null && contentEncoding .getValue ().equalsIgnoreCase ("gzip" )) {
260260 InputStream instream = entity .getContent ();
261- instream = new GZIPInputStream (instream );
261+ GZIPInputStream gzipInputStream = new GZIPInputStream (instream );
262262
263- InputStreamReader reader = new InputStreamReader (instream );
263+ InputStreamReader reader = new InputStreamReader (gzipInputStream );
264264 BufferedReader in = new BufferedReader (reader );
265265
266266 String readed ;
267267 responseData = "" ;
268268 while ((readed = in .readLine ()) != null ) {
269269 responseData += (readed );
270270 }
271+
272+ in .close ();
273+ reader .close ();
274+ gzipInputStream .close ();
275+ instream .close ();
271276 } else {
272277 responseData = EntityUtils .toString (entity );
273278 }
You can’t perform that action at this time.
0 commit comments