Java BufferedReader Create getBufferedReader(File file)

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

Description

Creates a buffered reader for a specified file.

License

Open Source License

Parameter

Parameter Description
file a parameter

Exception

Parameter Description
FileNotFoundException an exception

Return

A BufferedReader for the specified File.

Declaration

public static BufferedReader getBufferedReader(File file)
        throws FileNotFoundException 

Method Source Code

//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;

public class Main {
    /**/*from   w  ww. jav  a2s  .  c  o  m*/
     * Creates a buffered reader for a specified file.
     * @param file
     * @return A BufferedReader for the specified File.
     * @throws FileNotFoundException
     */
    public static BufferedReader getBufferedReader(File file)
            throws FileNotFoundException {
        FileInputStream fis = new FileInputStream(file);
        InputStreamReader isr = new InputStreamReader(fis);
        return new BufferedReader(isr);
    }
}

Related

  1. createBufferedReader( InputStream inputStream, String strCodepage)
  2. getBufferedReader(File file)
  3. getBufferedReader(File file, String charset)
  4. getBufferedReader(File file, String encoding)
  5. getBufferedReader(final File file)