The file 1 passed the info to file 2 in reverse order but still not passing the task.
package com.codegym.task.task18.task1809;
/*
Reversing a file
*/
import java.io.*;
import java.util.ArrayList;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
BufferedReader reader1 = new BufferedReader(new InputStreamReader(System.in));
FileInputStream fileinput = new FileInputStream(reader.readLine());
FileOutputStream output = new FileOutputStream(reader1.readLine());
ArrayList<Integer> test = new ArrayList<>();
while(fileinput.available() > 0){
int t = fileinput.read();
test.add(t);
}
for(int i =test.size(); i > 1; i--) {
try{
int t1 = test.get(i);
output.write(t1);
}
catch (Exception e){
}
}
fileinput.close();
output.close();
}
}