You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
784 B
24 lines
784 B
2 years ago
|
import java.io.*;
|
||
|
import java.util.Scanner;
|
||
|
|
||
|
public class FileTest {
|
||
|
public static void main(String[] args) throws IOException {
|
||
|
// 请在Begin-End间编写完整代码
|
||
|
/********** Begin **********/
|
||
|
// 使用字节输出流和输入流,把给定文件里的内容复制到另一个给定文件中
|
||
|
Scanner input = new Scanner(System.in);
|
||
|
String path1 = input.next();
|
||
|
String path2 = input.next();
|
||
|
FileInputStream fis = new FileInputStream(path1);
|
||
|
FileOutputStream fos = new FileOutputStream(path2);
|
||
|
int a = 0;
|
||
|
while((a=fis.read())!=-1){
|
||
|
fos.write(a);
|
||
|
}
|
||
|
fis.close();
|
||
|
fos.close();
|
||
|
|
||
|
|
||
|
/********** End **********/
|
||
|
}
|
||
|
}
|