Using Java 8 streams API, I want a way to call a reference method which accepts two arguments. splitFileByMaxRows
is the reference method that should take a String
and an int
as its arguments. Is there any way to achieve it?
private void breakLargeFileIntoChunks(final File setlFile, int parentFileId) {
LOG.info(LOG.isInfoEnabled() ? "*** Breaking Large File Into Chunks ***" : null);
try (Chunker chunker = new Chunker();
Stream<String> lines = Files.lines(Paths.get(setlFile.getAbsolutePath()))) {
lines.forEach(chunker::splitFileByMaxRows);
}
catch (IOException e) {
e.printStackTrace();
}
}