Java BufferedReader Create getReader(String path, String charEncoding)

Here you can find the source of getReader(String path, String charEncoding)

Description

get Reader

License

Apache License

Declaration

public static BufferedReader getReader(String path, String charEncoding)
            throws FileNotFoundException, UnsupportedEncodingException 

Method Source Code


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

import java.io.*;

public class Main {
    public static BufferedReader getReader(String path, String charEncoding)
            throws FileNotFoundException, UnsupportedEncodingException {
        return getReader(new File(path), charEncoding);
    }/*from  w w  w .j a  v a 2 s . c om*/

    public static BufferedReader getReader(File file, String charEncoding)
            throws FileNotFoundException, UnsupportedEncodingException {
        // TODO Auto-generated method stub
        InputStream is = new FileInputStream(file);
        return new BufferedReader(new InputStreamReader(is, charEncoding));
    }

    public static BufferedReader getReader(InputStream inputStream, String charEncoding)
            throws UnsupportedEncodingException {
        return new BufferedReader(new InputStreamReader(inputStream, charEncoding));
    }
}

Related

  1. getReader(String filename)
  2. getReader(String filePath, String charset)
  3. getReader(String path)
  4. getReader(String Path)
  5. getReader(String path, String charEncoding)
  6. getReaderAsString(Reader reader)
  7. getReaderText(BufferedReader reader)
  8. getStreamReader(InputStream input)
  9. getStreamText(InputStream stream)