将未缓冲的流转换为缓冲的流
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream;/* 来自 nowjava.com - 时 代 Java*/ import java.io.InputStreamReader; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class Main { public static void main(String[] args) { Path path = Paths.get("C:/folder1/equipment", "test.txt"); try (InputStream in = Files.newInputStream(path); BufferedReader reader = new BufferedReader(new InputStreamReader(in))) { /** 来 自 时 代 J a v a - N o w J a v a . c o m **/ String line = null;