Commit 39e8f663 authored by Jakob Schöttl's avatar Jakob Schöttl

Simplify file handling

parent 022e29ce
......@@ -39,17 +39,14 @@ public abstract class OutputFile<K extends Comparable<K>> {
}
public void write() {
try {
try (PrintWriter out = new PrintWriter(new FileWriter(fileName))) {
printHeader(out);
try (PrintWriter out = new PrintWriter(new FileWriter(fileName))) {
printHeader(out);
this.processors.stream().flatMap(p -> p.getKeys().stream())
.distinct().sorted()
.forEach(key -> printRow(out, key));
this.processors.stream().flatMap(p -> p.getKeys().stream())
.distinct().sorted()
.forEach(key -> printRow(out, key));
out.flush();
}
out.flush();
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment