- public static void copy_2() throws IOException {
-
- FileInputStream fis = new FileInputStream("F:\\a.mp3");// java.io.FileNotFoundException: F:\a.mp3 (文件名、目录名或卷标语法不正确。)
-
- BufferedInputStream bufis = new BufferedInputStream(fis);
-
- FileOutputStream fos = new FileOutputStream("F:\\1.mp3");
- BufferedOutputStream bufos = new BufferedOutputStream(fos);
-
- int ch = 0;
- while((ch = bufis.read())!=-1){
-
- bufos.write(ch);
- //bufos.flush();
- }
- bufos.close();
- bufis.close();
-
- }
复制代码 路径没有问题,复制txt文件也没有问题,就是复制MP3文件时出错,什么原因呢?
|
|