Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.ArrayList;
- import java.util.RandomAccess;
- public class HW01_2 {
- public static void main(String[] args) throws IOException {
- RandomAccessFile raf = new RandomAccessFile("izvor.txt", "r");
- PrintWriter pv=new PrintWriter(new FileOutputStream("destinacija.txt"));
- long pos=raf.length();
- raf.seek(pos--);
- int d;
- while(pos>-1){
- raf.seek(pos--);
- d=raf.read();
- pv.write(d);
- }
- raf.close();
- pv.close();
- pv.flush();
- }
- }
Add Comment
Please, Sign In to add comment