public class Solution {
    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in);
             InputStream inputStream = Files.newInputStream(Path.of(scanner.nextLine()));
             OutputStream outputStream = Files.newOutputStream(Path.of(scanner.nextLine()))) {
            byte[] bytes = new byte[1000];
            while (inputStream.available() > 0) {
                int read = inputStream.read(bytes);
                int temp;
                int temp2 = bytes[read - 1];
                for (int i = 1; i < read; i++) {

                    temp = bytes[i];
                    bytes[i] = bytes[i - 1];
                    bytes[i - 1] = (byte) temp;

                }
                if (temp2 % 2 != 0) {
                    bytes[read - 1] = (byte) temp2;
                }
                outputStream.write(bytes, 0, read);
            }
        } catch (IOException e) {
            System.out.println(e.getMessage());
        }
    }
}
Что именно происходит в цикле?