learning java FileInputStream

public class FileInputStreamTest {
    public static void main(String[] args) throws IOException {
        var fis = new FileInputStream("FileInputStreamTest.java");
        var bbuf = new byte[1024];

        var hasRead = 0;
        while ((hasRead = fis.read(bbuf)) > 0){
            System.out.println(new String(bbuf,0,hasRead));
        }
        fis.close();

    }

}

 

posted @ 2019-08-05 13:10  嵌入式实操  阅读(105)  评论(0编辑  收藏  举报