Java BufferedReader Read readFileByChar(String path)

Here you can find the source of readFileByChar(String path)

Description

read File By Char

License

Apache License

Declaration

public static Set<String> readFileByChar(String path) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.BufferedReader;

import java.io.FileReader;

import java.util.HashSet;

import java.util.Set;

public class Main {

    public static Set<String> readFileByChar(String path) throws Exception {
        Set<String> datas = new HashSet<String>();
        FileReader fr = new FileReader(path);
        BufferedReader br = new BufferedReader(fr);
        String line = null;/*from   w  w w .j a  va 2 s.  c  om*/
        while ((line = br.readLine()) != null) {
            datas.add(line);
        }
        br.close();
        fr.close();
        return datas;
    }
}

Related

  1. readFileAsList(String filename, String splitter)
  2. readFileAsListOfString(String fileName, String splitBy)
  3. readFileAsListOfStrings(String filename)
  4. readFileAsListOfStrings(String filename)
  5. readFileAsText(String path)
  6. readFileContext(File fileToRead)
  7. readFileEncoding(String file)
  8. readFileGdeHash(File gdeFile, ArrayList name, ArrayList seq)
  9. readFilePathToString(String filePath)