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();
    }
}


上一篇:Dubbo的多种序列化算法


下一篇:java-重置BufferedInputStream保留一个FileInputStream