content: package gr.aueb.cf.ch9;
  
  import java.io.*;
  import java.nio.charset.StandardCharsets;
  import java.time.LocalDateTime;
  import java.util.Scanner;
  
  public class FileReaderApp {
  
      public static void main(String[] args) {
  
      }
  
      public static void fileReaderRead(String file) throws IOException {
          try (FileReader fr = new FileReader(file)) {
              int ch;
  
              while ((ch = fr.read()) != -1) {
                  System.out.print((char) ch);
              }
          } catch (IOException e) {
              System.err.println(LocalDateTime.now() + "\n" + e);
              throw e;
          }
      }
  
  
      public static void scannerRead(File file) throws IOException {
          try (Scanner scanner = new Scanner(file, StandardCharsets.UTF_8)) {
              while (scanner.hasNextLine()) {
                  System.out.println(scanner.nextLine());
              }
          } catch (IOException e) {
              System.err.println(LocalDateTime.now() + "\n" + e);
              throw e;
          }
      }
  
      public static void bufferedRead(File file) throws IOException {
  //        try (BufferedReader br = new BufferedReader(new FileReader(file))) {
          try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))) {
  
              String line;
  
              while ((line = br.readLine()) != null) {
                  System.out.println(line);
              }
          } catch (IOException e) {
              System.err.println(LocalDateTime.now() + "\n" + e);
              throw e;
          }
      }
  }
  