Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class Solution {
- public static void main(String[] args) throws IOException
- {
- int sum = 0;
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- String infILE = reader.readLine();
- String outfILE = reader.readLine();
- //String infILE = "K:/data.txt";
- //String outfILE = "K:/data2.txt";
- FileInputStream fileInputStream = new FileInputStream(infILE);
- FileOutputStream outputStream = new FileOutputStream(outfILE);
- byte[] buffer = new byte[0];
- if (fileInputStream.available() > 0)
- {
- //читаем весь файл одним куском
- buffer = new byte[fileInputStream.available()];
- int count = fileInputStream.read(buffer);
- }
- for (int i = 0; i < buffer.length; i++)
- {
- outputStream.write(buffer[buffer.length-i-1]);
- }
- outputStream.close();
- fileInputStream.close();
- }
- }
Add Comment
Please, Sign In to add comment