I tried doing a list, array, string and reverse all - nothing works.
Can You tell me where is mistake because this task seems easy.
I think i miss something important.
package pl.codegym.task.task18.task1809;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Collections;
import java.util.*;
public class Solution {
public static void main(String[] args) throws IOException{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String file1 = reader.readLine();
String file2 = reader.readLine();
ArrayList<Byte> list = new ArrayList<Byte>();
FileInputStream inputStream = new FileInputStream(file1);
FileOutputStream outputStream = new FileOutputStream(file2);
byte[] buffer = new byte[10000];
while (inputStream.available() > 0){
int count = inputStream.read(buffer);
}
Collections.reverse(Arrays.asList(buffer));
for(int i = 0; i < buffer.length; i++){
outputStream.write(buffer[i]);
}
reader.close();
inputStream.close();
outputStream.close();
}
}