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

View File

@@ -63,13 +63,11 @@ public class AboutActivity extends AppCompatActivity {
appVersionInfo.setSummary(BuildConfig.VERSION_NAME);
String changes = null;
try {
InputStream is = getAssets().open("changelog.html");
try (InputStream is = getAssets().open("changelog.html")) {
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
changes = new String(buffer);
} catch (IOException ignored) {