Use try-with-resources in some places

This commit is contained in:
tonymanou
2017-01-12 02:02:52 +01:00
committed by topjohnwu
parent 57e6f3080c
commit 21b00ac6ca
5 changed files with 27 additions and 33 deletions
@@ -33,9 +33,9 @@ public class RepoDlReceiver extends DownloadReceiver {
ZipUtils.signZip(mContext, buffer.getInputStream(), buffer, true);
// Write it back to the downloaded zip
OutputStream out = mContext.getContentResolver().openOutputStream(mUri);
buffer.writeTo(out);
out.close();
try (OutputStream out = mContext.getContentResolver().openOutputStream(mUri)) {
buffer.writeTo(out);
}
}
}.exec();
}