InputStream字节输入流

Posted zhai1997

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了InputStream字节输入流相关的知识,希望对你有一定的参考价值。

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class FileInputStreamDemo 
    public static void main(String[] args) throws IOException 
        File file = new File("E:\\\\IO流\\\\java\\\\1.txt");
        FileInputStream f = new FileInputStream(file);
        int n = 0;
        while ((n = f.read()) != -1) 
            System.out.print((char) n);

        
        f.close();
    

技术图片

技术图片

 

以上是关于InputStream字节输入流的主要内容,如果未能解决你的问题,请参考以下文章