java字节流复制视频文件

/*实测有效*/
package io_511;
import java.io.*;

public class HomeWork {
    
    
    public static void main(String[] args) throws IOException {
    
    
      
        FileInputStream fis=new FileInputStream("D:\\java\\IMG_6365.MP4");
        FileOutputStream fos=new FileOutputStream("D:\\code\\copy3.MP4");

        byte input[]=new byte[1024];
        //char[] c=new char[1024];
        while(fis.read(input)!=-1) {
    
    
            fos.write(input);
        }
        fis.close();
        fos.close();
    }
}

猜你喜欢

转载自blog.csdn.net/qq_45750230/article/details/106086202
今日推荐