java/IO流拷贝视频
package ketang82;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class CopyBy {
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
FileInputStream fileInputStream = new FileInputStream("ant.mp4");
FileOutputStream fileOutputStream = new FileOutputStream("ant_new.mp4");
byte input[] = new byte[100];
while (fileInputStream.read(input)!=-1) {
fileOutputStream.write(input);
}
fileInputStream.close();
fileOutputStream.close();
System.out.println("yes");
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}