Advertisement
Josif_tepe

Untitled

Mar 20th, 2021
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1.     import java.io.*;
  2. import java.lang.*;
  3.     import java.nio.charset.StandardCharsets;
  4.  
  5.     public class Main {
  6.  
  7.         public static void main(String[] args) {
  8.             try {
  9.                 InputStream in = new FileInputStream("in.txt");
  10.                 int n = in.read();
  11.                 while(n != -1) {
  12.                     System.out.write(n);
  13.  
  14.                     n = in.read();
  15.  
  16.                 }
  17.             }
  18.             catch (IOException ex) {
  19.                 System.out.println(ex);
  20.             }
  21.             System.out.flush();
  22.         }
  23.     }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement