Java BufferedReader Read ReadFile(String file)

Here you can find the source of ReadFile(String file)

Description

Read File

License

Open Source License

Declaration

public static void ReadFile(String file) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedReader;

import java.io.FileReader;

import java.io.IOException;

public class Main {
    public static void ReadFile(String file) {
        // Membaca isi file
        try {/*w  w w.  j  a v a2s  . c  om*/
            BufferedReader in = new BufferedReader(new FileReader(file));
            String str;
            // Membaca sampai akhir stream
            while ((str = in.readLine()) != null) {
                System.out.println(str);
            }
            // Menutup stream dan melepaskan resource
            in.close();
        } catch (IOException ex) {
            System.err.println(ex.getMessage());
        }

    }
}

Related

  1. readFile(String file)
  2. readFile(String file)
  3. readFile(String file)
  4. readFile(String file)
  5. readFile(String file)
  6. readFile(String file)
  7. readFile(String file)
  8. readFile(String file)
  9. readFile(String file)