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) Math.min(length-pos, bufSize)); int idx = indexOf_byteArray(buf, (byte) '\n'); if (idx >= 0) ret pos+idx+1; pos += bufSize; } ret length; }