| 哥。你这不是没有COPY完的问题,这个代码根本就不能COPY视频;这个叫字符读取流,只能读写文本、要COPY视频需要字节读取流:FileInputStream,FileOutputStream; 刚好我也刚刚写了一个一样的代码。分享下;
 import java.io.*;
 class  CopyMedia
 {
 public static void main(String[] args)
 {
 FileOutputStream fos= null;
 FileInputStream fis = null;
 try
 {
 fos=new FileOutputStream("f:\\陈奕迅 - K歌之王.mp3");
 fis=new FileInputStream("d:\\陈奕迅 - K歌之王.mp3");
 
 byte[] buf=new byte[1024*10];
 int len=0;
 
 while ((len=fis.read(buf))!=-1)
 {
 fos.write(buf,0,len);
 }
 
 }
 catch (IOException e)
 {
 throw new RuntimeException("读写失败");
 }
 finally
 {
 try
 {
 if (fos!=null)
 {
 fos.close();
 }
 }
 catch (IOException e)
 {
 throw new RuntimeException("读取关闭失败");
 }
 try
 {
 if (fis!=null)
 {
 fis.close();
 }
 }
 catch (IOException e)
 {
 throw new RuntimeException("写入关闭失败");
 }
 
 }
 
 }
 }
 
 |