I want to read the text file and after that get the offset to which file is read.I tried the following program but the thing is i dont want to use RandomAccessFile,how can i do that.
RandomAccessFile access = null;
try {
access = new RandomAccessFile(file, "r");
if (file.length() < addFileLen) {
access.seek(file.length());
} else {
access.seek(addFileLen);
}
} catch (Exception e) {
e.printStackTrace();
}
String line = null;
try {
while ((line = access.readLine()) != null) {
System.out.println(line);
addFileLen = file.length();
}