首页 > 其他 > 详细

【字符输入流:InputStreamReader】

时间:2018-11-12 15:31:41      阅读:163      评论:0      收藏:0      [点我收藏+]
package test;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author shusheng
 * @description
 * @Email shusheng@yiji.com
 * @date 2018/11/12 11:00
 */
public class InputStreamReaderDemo1 {

    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(
                new FileInputStream("C:\\Users\\shusheng\\Pictures\\111.txt"));
        char[] chs = new char[1024];
        int len = 0;
        while ((len = isr.read(chs)) != -1) {
            System.out.println(new String(chs, 0, len));
        }
        isr.close();
    }

}

 

【字符输入流:InputStreamReader】

原文:https://www.cnblogs.com/zuixinxian/p/9946544.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!