channel_size와 file_length가 다른 상황이 있습니까? new File(name).length()
항상 주어진 경로를 확인하기 때문에Java Channel.size() vs File.length
File file = new File(name);
FileInputStream stream = new FileInputStream(file);
FileChannel channel = stream.getChannel();
long channel_size = channel.size();
long file_length = file.length();
두 값을 모두 출력하고 다른 값으로 표시되는 이유는 무엇입니까? –
@ JoshM 나는 OP가 그렇지 않은 상황을 찾고 있다고 생각합니다. –