JAvaによるファイルコピーの実装
548 ワード
package filetest;
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException;
public class FileTest1 { public static void main(String[] args) throws IOException {
}
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException;
public class FileTest1 { public static void main(String[] args) throws IOException {
//
FileInputStream fi=new FileInputStream("D:/abc/aa.txt");
byte[] buf= fi.readAllBytes();//Java9
//
FileOutputStream fo=new FileOutputStream("D:/abc/aaa.txt");
fo.write(buf);
//
fo.close();
fi.close();
}
}