Java File Read by Charset open(File file, Charset charset)

Here you can find the source of open(File file, Charset charset)

Description

open

License

Apache License

Declaration

public static BufferedReader open(File file, Charset charset) throws FileNotFoundException 

Method Source Code


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

import java.io.BufferedReader;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;

public class Main {

    public static BufferedReader open(File file, Charset charset) throws FileNotFoundException {
        InputStream in = new FileInputStream(file);
        return new BufferedReader(new InputStreamReader(in, charset));
    }//from  ww w.ja  v  a2  s . c  o m

    public static BufferedReader open(String filePath, Charset charset) throws FileNotFoundException {
        return open(new File(filePath), charset);
    }
}

Related

  1. isEqual(final File document, final Charset a, final Charset b)
  2. load(File file, Charset charset)
  3. loadFile(File file, Charset cs)
  4. loadFile(File logfile, Charset charset)
  5. loadString(File f, Charset charset)
  6. parseNameDelimiterValueNewLineFile( File nameDelimiterValueNewLineFile, String nameValueDelimiter, Charset charset)
  7. saveFile(File file, String content, String charsetName)
  8. saveToFile(File dest, String contents, Charset cs)
  9. setFileText(File file, Charset charset, String text)