编程语言
首页 > 编程语言> > java字节缓冲流

java字节缓冲流

作者:互联网


import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;

//字节缓冲流
public class BufferInputStream1 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream("E:\\Workpace\\abc.txt"));
        byte[] bytes = new byte[1024];
        int len;
        while ((len = inputStream.read(bytes)) != -1){
            System.out.print(new String(bytes,0,len));
        }
        inputStream.close();
    }
}


标签:java,字节,BufferedInputStream,缓冲,len,io,import,new
来源: https://www.cnblogs.com/codegzy/p/14723883.html