javeee 字节Buffered
package Zy; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class Zy04 { //4.用缓冲字节流完成eclipse.zip的复制 public static void main(String[] args) throws IOException { long time1=System.currentTimeMillis(); FileInputStream fis=new FileInputStream("e:\\eclipse.zip"); BufferedInputStream bf=new BufferedInputStream(fis); FileOutputStream fos=new FileOutputStream("e:\\java\\123\\eclipse.zip"); BufferedOutputStream bd=new BufferedOutputStream(fos); byte[] bytes=new byte[1024]; int len=0; while((len=bf.read(bytes))!=-1){ bd.write(bytes,0,len); bd.flush(); } bd.close(); long time2=System.currentTimeMillis(); System.out.println((time2-time1)/1000); } }