как решить
package com.javarush.task.task18.task1809;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/*
Реверс файла
*/
public class Solution {
public static void main(String[] args) throws IOException {
FileInputStream fis = new FileInputStream(new BufferedReader(new InputStreamReader(System.in)).readLine());
FileOutputStream fos = new FileOutputStream(new BufferedReader(new InputStreamReader(System.in)).readLine());
int count = fis.available();
byte [] b = new byte[fis.available()];
int i = 0;
if (fis.available() > 0){
i = fis.read(b);
for(int c = 0; c < b.length; c++){
System.out.print(b[c] + " ");
}
for(int i1 = 0; i1 < b.length; i1++){
for(int j = 0; j < b.length; j++){
if(b[i1] >= b[j]){
byte x = b[i1];
b[i1] = b[j];
b[j] = x;
}
}
}
for (byte value : b) {
System.out.print(value + " ");
}
fos.write(b);
}
fis.close();
fos.close();
}
}