Bug 1356693 - Pre: use IOUtils.safeStreamClose() in IOUtils
MozReview-Commit-ID: 3dikakcAKqI
--- 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.