I have a file format for potentially large files where the first line is special. I'd like to open the file once and treat it as a stream of lines, but handle the first line differently from all of the other lines. The others get map/collected, the first line needs to be just parsed into some flags. Is there a way?
This starts as:
result = Files.lines(path).map(something).collect(Collectors.toList());
except that I want to divert the first line.