Here you can find the source of getReader(final String fileName)
Parameter | Description |
---|---|
fileName | a parameter |
Parameter | Description |
---|---|
UnsupportedEncodingException | an exception |
FileNotFoundException | an exception |
public static BufferedReader getReader(final String fileName) throws UnsupportedEncodingException, FileNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; public class Main { /**//from w w w . j av a2s.c o m * Get a BufferedReader for the file of the given fileName * @param fileName * @return * @throws UnsupportedEncodingException * @throws FileNotFoundException */ public static BufferedReader getReader(final String fileName) throws UnsupportedEncodingException, FileNotFoundException { return getReader(new FileInputStream(fileName)); } public static BufferedReader getReader(final InputStream in) throws UnsupportedEncodingException { return new BufferedReader(new InputStreamReader(in, "UTF-8")); } }