集册 Java实例教程 将未缓冲的流转换为缓冲的流

将未缓冲的流转换为缓冲的流

欢马劈雪     最近更新时间:2020-01-02 10:19:05

565
将未缓冲的流转换为缓冲的流

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;

      
展开阅读全文