Java BufferedReader Create getReader(File file)

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

Description

Returns a reader object

License

Open Source License

Parameter

Parameter Description
file a parameter

Declaration

public static BufferedReader getReader(File file) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedReader;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;

public class Main {
    /**/*from   w w w  .  j  av  a  2s .c om*/
     * Returns a reader object
     * @param file
     * @return
     */
    public static BufferedReader getReader(File file) {
        BufferedReader reader = null;

        try {
            reader = new BufferedReader(new FileReader(file));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            throw new RuntimeException("Unable to get a reader!");
        }
        return reader;
    }
}

Related

  1. getBufferedReaderMaybeGZ(String f)
  2. getReader()
  3. getReader(File file)
  4. getReader(File file)
  5. getReader(File file)
  6. getReader(File inFile)
  7. getReader(File queryFile)
  8. getReader(final File inputFile)
  9. getReader(final InputStream is, final String enc)