искренне не понимаю, почему это не работает
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();
FileInputStream inputStream1 = new FileInputStream("c:/javarush/data.txt");
FileOutputStream outputStream2 = new FileOutputStream("c:/javarush/result.txt");
if (inputStream1.available() > 0) {
byte[] buffer = new byte[inputStream1.available()];
sort(buffer); //переворот массива
int count = inputStream1.read(buffer);
outputStream2.write(buffer, 0, count);
}
inputStream1.close();
outputStream2.close();
}
public static void sort(byte[] massive) {
for (int i = 0; i < massive.length / 2; i++) {
byte tmp = massive[i];
massive[i] = massive[massive.length - i - 1];
massive[massive.length - i - 1] = tmp;
}
}
}