텍스트 파일을 읽은 후 그 파일이 읽혀지는 오프셋을 얻습니다. 다음 프로그램을 시도했지만 그 일은 내가 RandomAccessFile을 사용하고 싶지 않습니다. 어떻게 할 수 있습니까? .파일을 읽은 다음 끝으로 이동
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();
}
RandomAccessFile을 사용하지 않으려면 무엇을 원하십니까? – JRideout
아무거나는 작동 할 것입니다. – Rookie
http://docs.oracle.com/javase/tutorial/essential/io/file.html ByteChannels에 대한 정보 찾기 – Kris