Advertisement
Josif_tepe

Untitled

Mar 23rd, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import java.io.*;
  2. public class Main {
  3.  
  4.     public static void main(String[] args) {
  5.         FileInputStream in = null;
  6.         try {
  7.              in = new FileInputStream("in0.txt");
  8.             byte[] b = new byte[in.available()];
  9.             in.read(b);
  10.             System.out.write(b);
  11.  
  12.         }
  13.         catch (IOException ex) {
  14.             System.out.println(ex);
  15.         }
  16.         finally {
  17.             try {
  18.                 if(in != null)
  19.                      in.close();
  20.             }
  21.             catch (IOException ex) {
  22.                 System.out.println(ex);
  23.             }
  24.         }
  25.     System.out.flush();
  26.     }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement