public void write() throws IOException {
String splitter = String.join("", Collections.nCopies(settings.page.width, "-"));
List<String> headLines = columnsToRows(getColumnTitles());
try (BufferedWriter writer = Files.newBufferedWriter(outputPath, DEFAULT_CHARSET)) {
inputData.stream().map(this::columnsToRows).flatMap(List::stream).forEach(writer::write);
}
}
public void write() throws IOException {
List<String> columnTitles = settings.columns.stream().map(x -> x.title).collect(Collectors.toList());
String splitter = String.join("", Collections.nCopies(settings.page.width, "-"));
List<String> headLines = columnsToRows(columnTitles);
try (BufferedWriter writer = Files.newBufferedWriter(outputPath, DEFAULT_CHARSET)) {
Stream<String> lines = inputData.stream().flatMap(x -> columnsToRows(x).stream().limit(columnTitles.size()));
Iterator<String> iterator = lines.iterator();
while (iterator.hasNext()) {
String line = iterator.next();
writer.write(line);
}
}
}
public void write() {
String splitter = String.join("", Collections.nCopies(settings.page.width, "-"));
List<String> headLines = columnsToRows(getColumnTitles());
try (BufferedWriter writer = Files.newBufferedWriter(outputPath, DEFAULT_CHARSET)) {
inputData.stream().map(this::columnsToRows).flatMap(List::stream).forEach(writer::write);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}