Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lab_1;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.util.ArrayList;
- import java.util.List;
- public class HW01_2 {
- public static void main(String[] args) {
- try(FileInputStream in = new FileInputStream(new File("izvor.txt"));
- FileOutputStream out = new FileOutputStream(new File("destinacija.txt"));
- ){
- int c = 0;
- List<Integer> data = new ArrayList<>();
- while ((c = in.read()) != -1){
- data.add(0, c);
- }
- for (Integer i : data){
- out.write(i);
- }
- } catch (IOException e) {
- System.err.println(e.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement