Spellchecker: (minor) buffered reader stream of lines instead of readLine() in cycle

This commit is contained in:
Olga Strizhenko
2017-09-15 09:25:09 +03:00
parent bd09423b1b
commit 021aa868ee
@@ -46,10 +46,7 @@ public class StreamLoader implements Loader {
static void doLoad(@NotNull InputStream stream, @NotNull Consumer<String> consumer) {
try (BufferedReader br = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) {
String line;
while ((line = br.readLine()) != null) {
consumer.consume(line);
}
br.lines().forEach(consumer::consume);
}
catch (Exception e) {
Logger.getInstance(StreamLoader.class).error(e);