如果只是读取,用BufferedReader应该很快.

解决方案 »

  1.   

    import java.io.*;public class CopyFile
    {
    public static void main(String args[])
    {
    if(args.length != 2)
    {
    System.out.println("input: source target");
    System.exit(0);
    }
    String source = args[0];
    String target = args[1];
    try
    {
    File newFile = null;
    newFile = new File(target);
    newFile.createNewFile();
    FileInputStream in = new FileInputStream(new File(source));
    FileOutputStream out = new FileOutputStream(newFile);
    int i = 0;
    while((i = in.read())!=-1)
    {
    out.write(i);
    }
    in.close();
    out.close();
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
    }
    }
    刚才拷贝了一首MP3试了一下,还没有用Buffer
      

  2.   

    应该是用BufferedInputStream
    BufferedReader是基于字符的!