Bug 1356693 - Pre: use IOUtils.safeStreamClose() in IOUtils draft
authorAndrzej Hunt <ahunt@mozilla.com>
Fri, 14 Apr 2017 15:24:45 -0700
changeset 569893 f75ab922115e204ea80b5a91d6c8172226ec39d0
parent 569701 2cca333f546f38860f84940d4c72d7470a3410f4
child 569894 bf3b3797097cfda7e418e38be419650b6de11b9a
push id56302
push userahunt@mozilla.com
push dateFri, 28 Apr 2017 00:45:18 +0000
bugs1356693
milestone55.0a1
Bug 1356693 - Pre: use IOUtils.safeStreamClose() in IOUtils MozReview-Commit-ID: 3dikakcAKqI
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/IOUtils.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/IOUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/IOUtils.java
@@ -85,21 +85,17 @@ public class IOUtils {
                     buffer = newBuffer;
                 }
             }
 
             return new ConsumedInputStream(bPointer + 1, buffer);
         } catch (IOException e) {
             Log.e(LOGTAG, "Error consuming input stream.", e);
         } finally {
-            try {
-                iStream.close();
-            } catch (IOException e) {
-                Log.e(LOGTAG, "Error closing input stream.", e);
-            }
+            IOUtils.safeStreamClose(iStream);
         }
 
         return null;
     }
 
     /**
      * Truncate a given byte[] to a given length. Returns a new byte[] with the first length many
      * bytes of the input.