使用InputStream非缓冲流逐字节读取
import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path;//N o w J a v a . c o m - 时代Java 提供 import java.nio.file.Paths; public class Main { public static void main(String[] args) { Path path = Paths.get("C:/folder1/equipment", "test.txt"); int n; byte[] in_buffer = new byte[1024]; try (InputStream in = Files.newInputStream(path)) { while ((n = in.read(in_buffer)) != -1) { System.out.println(