import java.io.*;
// 字节传输的缓冲流
public class Buff1 {
public static void main(String[] args) {
BufferedInputStream bos=null;
try {
// 读取D盘的内容
bos=new BufferedInputStream(new FileInputStream("d:\\IO\\ac.txt"));
// 速度为1kb
byte [] b=new byte[1024];
int len=0;
// read不能你等与-1
while ((len=bos.read(b))!=-1){
System.out.println(new String(b,0,len));
}
} catch (Exception e) {
e.printStackTrace();
}finally{
if(bos!=null){
try {
bos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}