Here you can find the source of getReader(File file)
Parameter | Description |
---|---|
file | a parameter |
Parameter | Description |
---|---|
FileNotFoundException | an exception |
UnsupportedEncodingException | an exception |
private static BufferedReader getReader(File file) throws FileNotFoundException, UnsupportedEncodingException
//package com.java2s; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; public class Main { /**// w ww . ja v a 2 s .co m * @param file * @return reader using UTF-8 * @throws FileNotFoundException * @throws UnsupportedEncodingException */ private static BufferedReader getReader(File file) throws FileNotFoundException, UnsupportedEncodingException { return new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); } }