import java.io.*;
public class CopyDemo {
public static void main(String[] args) throws Exception{
BufferedInputStream bufIn = new BufferedInputStream(new FileInputStream("c:\\1.mp3"));
BufferedOutputStream bufOut = new BufferedOutputStream(new FileOutputStream("d:\\2.mp3"));
byte[] buf = new byte[1024];
int ch = -1;
while((ch=bufIn.read(buf))!=-1){
bufOut.write(buf,0,buf.length);
}
bufIn.close();
bufOut.close();
}
}
|