joseleonweb

Untitled

Feb 27th, 2021
666
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         try {
  2.             // read bytes until End Of File is encountered
  3.             do {
  4.                 i = fin.read(); // Read from the file
  5.                 if(i != -1) System.out.print((char) i);
  6.             } while(i != -1); // When i equals -1, the EOF has been reached
  7.         } catch(IOException exc) {
  8.             System.out.println("Error reading file.");
  9.         } finally {
  10.             // Close file on the way out of the try block
  11.             try {
  12.                 fin.close(); // Close the file
  13.             } catch(IOException exc) {
  14.                 System.out.println("Error closing file.");
  15.             }
  16.         }
  17.     }
  18. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×