main(String[] args) {
try {
FileInputStream fis = new FileInputStream("/users/yifei/desktop/assets/timg.gif");
BufferedInputStream bis = new BufferedInputStream(fis);
FileOutputStream fos = new FileOutputStream("/users/yifei/desktop/assets/timg1.gif");
BufferedOutputStream bos = new BufferedOutputStream(fos);
long l = System.currentTimeMillis();
int n= 0;
while((n=bis.read())!=-1) { //将图片读出存入缓存区
bos.write(n); //图片写入缓存区
}
bos.flush();//刷新缓冲区
fis.close();
bis.close();
fos.close();
bos.close();
System.out.println((System.currentTimeMillis()-l)/1000);
} catch (FileNotFoundException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}