import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class CopyFile { /** * @param args */ public static void main(String[] args) { try { FileInputStream fis = new FileInputStream ("E://a.mp3"); FileOutputStream fos = new FileOutputStream ("E://temp.mp3"); BufferedInputStream bis=new BufferedInputStream(fis); BufferedOutputStream bos=new BufferedOutputStream(fos); int read = bis.read(); while ( read != -1 ) { bos.write(read); read = bis.read(); } bis.close(); bos.close(); } catch (IOException e) { e.printStackTrace(); } } }
时间: 2024-10-18 08:31:01