Java Utililty Methods BufferedReader Create

List of utility methods to do BufferedReader Create

Description

The list of methods to do BufferedReader Create are organized into topic(s).

Method

BufferedReadergetBufferedReaderFromInputStream(InputStream src)
BufferedReaders are really useful for reading files (or other streams for that matter) line by line.
BufferedReader br = new BufferedReader(new InputStreamReader(new DataInputStream(src)));
return br;
BufferedReadergetBufferedReaderFromInputStreamReader(InputStreamReader isReader)
get Buffered Reader From Input Stream Reader
return new BufferedReader(isReader);
BufferedReadergetBufferedReaderMaybeGZ(String f)
get Buffered Reader Maybe GZ
try {
    InputStream is;
    if (!new File(f).exists() && new File(f + ".gz").exists()) {
        f += ".gz"; 
    FileInputStream fis = new FileInputStream(f);
    if (f.toLowerCase().endsWith(".gz")) {
        is = new GZIPInputStream(fis);
...
BufferedReadergetReader()
Method getReader returns the reader of this ConsoleUtils object.
if (bufferedReader == null) {
    bufferedReader = new BufferedReader(new InputStreamReader(System.in));
return bufferedReader;
ReadergetReader(File file)
get Reader
return new BufferedReader(new InputStreamReader(new FileInputStream(file)));
BufferedReadergetReader(File file)
get Reader
return new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
BufferedReadergetReader(File file)
Returns a buffered reader for a file.
if (file.getName().endsWith(".gz")) {
    return new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(file))));
return new BufferedReader(new FileReader(file));
BufferedReadergetReader(File file)
Returns a reader object
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;
...
BufferedReadergetReader(File inFile)
Gets the reader.
FileInputStream rfis = new FileInputStream(inFile);
InputStreamReader risr = new InputStreamReader(rfis, "UTF-8");
BufferedReader rbr = new BufferedReader(risr);
return rbr;
BufferedReadergetReader(File queryFile)
get Reader
BufferedReader br = null;
br = new BufferedReader(new FileReader(queryFile));
return br;