Here you can find the source of readerBuffered(final File file, final Charset charset)
Parameter | Description |
---|---|
file | the file to open |
charset | the charset to decode the file contents |
Parameter | Description |
---|---|
FileNotFoundException | if the file could not be opened |
public static final BufferedReader readerBuffered(final File file, final Charset charset) throws FileNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.nio.charset.Charset; public class Main { /** Open a buffered {@link Reader}, equivalent to:<br/> * {@code new BufferedReader(new InputStreamReader(new FileInputStream(file), charset));} * @param file the file to open/* w ww .j a v a2 s. c om*/ * @param charset the charset to decode the file contents * @return the buffered reader from the file * @throws FileNotFoundException if the file could not be opened */ public static final BufferedReader readerBuffered(final File file, final Charset charset) throws FileNotFoundException { BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)); return reader; } }