Hey man,
I found your repo and it just what I needed to index a big text file is it is fast my biggest file has around 60,000 lines and it ran in less than a sec.
I ran your tests, and some of the test are failing due to calling incrementCounters() twice when \n and \r is found. Anyways I'll try to get this fixed after running a few more tests.
At line 55 on FileLinesIterator:
while (true) {
if (!refillBufferIfNeeded()) break;
final char nextChar = (char) buffer[positionInBuffer];
if (!isLineDelimiter(nextChar)) {
stringBuilder.append(nextChar);
} else if (isCarriageReturnFollowedByLineFeed(nextChar)) {
incrementCounters();
}
incrementCounters(); // BUG This is counting lineLenght twice at \r and \n
if (isLineDelimiter(nextChar)) break;
}
if (lineLength == 0) {
closeInputStream();
throw new NoSuchElementException();
}
return line(stringBuilder.toString(), lineLength);
Hey man,
I found your repo and it just what I needed to index a big text file is it is fast my biggest file has around 60,000 lines and it ran in less than a sec.
I ran your tests, and some of the test are failing due to calling incrementCounters() twice when \n and \r is found. Anyways I'll try to get this fixed after running a few more tests.
At line 55 on FileLinesIterator: