import java.io.*;
public class IOTest02 {
public static void main(String[] args) throws IOException{
try{
FileInputStream in = new FileInputStream("F:/in.txt"); //来源文件
FileOutputStream os = new FileOutputStream("F:/os.txt"); //目的文件
BufferedInputStream bIn = new BufferedInputStream(in); //缓冲输入流
BufferedOutputStream bOs = new BufferedOutputStream(os); //缓冲输出流
byte b[] = new byte[1]; //接收数据的字节数组
//将缓冲区的数据全部输出
while(bIn.read(b)!=-1){
bOs.write(b);
}
bOs.flush(); //刷新缓冲输出流
bIn.close(); //关闭输入流
bOs.close(); //关闭输出流
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}