Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class KopirovaniSouboru
- {
- public static void main(String[] argv) throws IOException {
- if (argv.length != 2) return;
- File soubor1 = new File(argv[0]);
- File soubor2 = new File(argv[1]);
- if (!soubor1.isFile()) return;
- if (soubor2.exists()) soubor2.delete();
- RandomAccessFile zdroj = new RandomAccessFile(soubor1,"r");
- RandomAccessFile cil = new RandomAccessFile(soubor2,"rw");
- for (int n = 0; n < soubor1.length(); n++)
- cil.writeByte(zdroj.readByte());
- zdroj.close();
- cil.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement