Java BufferedReader Create getReader(File file)

Here you can find the source of getReader(File file)

Description

get Reader

License

Open Source License

Parameter

Parameter Description
file a parameter

Exception

Parameter Description
FileNotFoundException an exception
UnsupportedEncodingException an exception

Return

reader using UTF-8

Declaration

private static BufferedReader getReader(File file) throws FileNotFoundException, UnsupportedEncodingException 

Method Source Code


//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"));
    }
}

Related

  1. getBufferedReaderFromFileName(File file)
  2. getBufferedReaderFromInputStream(InputStream src)
  3. getBufferedReaderFromInputStreamReader(InputStreamReader isReader)
  4. getBufferedReaderMaybeGZ(String f)
  5. getReader()
  6. getReader(File file)
  7. getReader(File file)
  8. getReader(File file)
  9. getReader(File inFile)