static long raf_findEndOfLine(RandomAccessFile raf, long pos, int bufSize) ctex { byte[] buf = new byte[bufSize]; long length = raf.length(); while (pos < length) { raf.seek(pos); raf.readFully(buf, 0, (int) min(length-pos, bufSize)); int idx = indexOf_byteArray(buf, (byte) '\n'); if (idx >= 0) ret pos+idx+1; pos = start+bufSize; } ret length; }