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();
}
}
相关文章
- 08-04013字节流写出、字符流写出、综合练习
- 08-04字节流&&字节缓冲流
- 08-04字节流+字符流
- 08-04IO流之字节流
- 08-04使用字符缓冲流读取数据
- 08-04字符缓冲区输入输出流
- 08-04zeroMQ消息传送的是一个固定长度的二进制数据,而TCP是通过字节流,那二进制流和字节流有啥区别?
- 08-04字符输出流,缓冲流
- 08-04day21【缓冲流、转换流、序列化流】
- 08-04117-BufferedIutputStream字节缓冲输入流