package com.heima.Exercise;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class Exercise02_02 {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
long start =System.currentTimeMillis();
FileInputStream fis = new FileInputStream("E:\\Entertainment\\MOVIE\\飘花电影piaohua.com北京遇上西雅图HD1280高清.mkv");
BufferedInputStream bis = new BufferedInputStream(fis);
FileOutputStream fos = new FileOutputStream("E:\\少女时代_Gee.(720P).avi");
BufferedOutputStream bos = new BufferedOutputStream(fos);
/* int len ;
byte[] arr = new byte[1024*8];
while((len=fis.read(arr))!=-1){
fos.write(arr, 0, len);
}*/
int b;
while ((b=bis.read())!=-1){
bos.write(b);
}
bis.close();
bos.close();
long finish =System.currentTimeMillis();
long passtime = (finish - start)/1000 ;
System.out.println("Complete Again!!!It casts "+passtime+" seconds!!");
}
}
|