1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-06-17 08:54:49 +02:00

Close stream in FileUtils.addLines()

This commit is contained in:
Florian Schmaus 2018-08-13 16:39:56 +02:00
parent 5517d03fae
commit 6fb95d6226

View file

@ -90,10 +90,15 @@ public final class FileUtils {
InputStream is = getStreamForUri(uri, null); InputStream is = getStreamForUri(uri, null);
InputStreamReader sr = new InputStreamReader(is, StringUtils.UTF8); InputStreamReader sr = new InputStreamReader(is, StringUtils.UTF8);
BufferedReader br = new BufferedReader(sr); BufferedReader br = new BufferedReader(sr);
try {
String line; String line;
while ((line = br.readLine()) != null) { while ((line = br.readLine()) != null) {
set.add(line); set.add(line);
} }
}
finally {
br.close();
}
return true; return true;
} }