Hey,
I'm trying to seek through a RandomAccessFile, and as part of an algorithm I have to read a line, and then seek backwards from the end of the line
E.g
String line = raf.readLine();
raf.seek (raf.getFilePointer() - line.length() + m.start() + m.group().length());
//m is a Matcher for regular expressions
I've been getting loads of off-by-one errors and couldn't figure out why. I just discovered it's because some files I'm reading from have UNIX-style linefeeds, \r\n, and some have just windows-style \n.
Is there an easy to have the RandomAccessFile treat all linefeeds as windows-style linefeeds?