Advertisement
seberm

seberm

Sep 20th, 2009
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import java.io.*;
  2. public class KopirovaniSouboru
  3. {
  4. public static void main(String[] argv) throws IOException {
  5. if (argv.length != 2) return;
  6. File soubor1 = new File(argv[0]);
  7. File soubor2 = new File(argv[1]);
  8. if (!soubor1.isFile()) return;
  9. if (soubor2.exists()) soubor2.delete();
  10. RandomAccessFile zdroj = new RandomAccessFile(soubor1,"r");
  11. RandomAccessFile cil = new RandomAccessFile(soubor2,"rw");
  12. for (int n = 0; n < soubor1.length(); n++)
  13. cil.writeByte(zdroj.readByte());
  14. zdroj.close();
  15. cil.close();
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement