deyanmalinov

1. Read File---Streams, Files And Directories - Lab

Apr 8th, 2020
101
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.FileInputStream;
  2. import java.io.IOException;
  3. public class Main {
  4.     public static void main(String[] args) throws IOException {
  5.         String path = "D:\\Coding" +
  6.                 "\\BG_Softuni\\Java Advanced - January 2019" +
  7.                 "\\04. Java-Advanced-Fiels-and-Directories-Lab" +
  8.                 "\\04. Java-Advanced-Files-and-Streams-Lab-Resources\\input.txt";
  9.         FileInputStream file = new FileInputStream(path);
  10.         int oneByte = file.read();
  11.         while ((oneByte = inFile.read()) >= 0){
  12.             System.out.print(Integer.toBinaryString(oneByte)+" ");
  13.        }
  14.     }
  15. }
RAW Paste Data