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

ReadergetBufferedReader(Reader r)
Wraps the specified reader in a buffered reader.
if (r instanceof BufferedReader || r instanceof StringReader)
    return r;
return new BufferedReader(r);
BufferedReadergetBufferedReader(Reader rd)
Get BufferedReader.
BufferedReader br = null;
if (br instanceof java.io.BufferedReader) {
    br = (BufferedReader) rd;
} else {
    br = new BufferedReader(rd);
return br;
BufferedReadergetBufferedReader(String directory, String filename)
Returns a BufferedReader.
if (!exists(directory, filename) && exists(directory, filename + ".gz")) {
    filename = filename + ".gz";
InputStream stream = new FileInputStream(new File(directory, filename));
if (filename.endsWith(".gz")) {
    stream = new GZIPInputStream(stream);
return new BufferedReader(new InputStreamReader(stream, FILE_ENCODING));
...
BufferedReadergetBufferedReader(String file)
get Buffered Reader
BufferedReader reader = null;
try {
    reader = new BufferedReader(new FileReader(file));
} catch (Exception e) {
return reader;
BufferedReadergetBufferedReader(String filename)
getBufferedReader
if (filename == "") {
    return null;
if (filename.equals("-")) {
    System.err.println("Processing input from std in.");
    return new BufferedReader(new InputStreamReader(System.in));
File inputFile = new File(filename);
...
BufferedReadergetBufferedReader(String filename, String encoding)
get Buffered Reader
if (filename.endsWith(GZIP_FILENAME_EXTENSION))
    return new BufferedReader(new InputStreamReader(
            (InputStream) new GZIPInputStream(new FileInputStream(filename)), encoding));
else
    return new BufferedReader(new InputStreamReader((InputStream) new FileInputStream(filename), encoding));
BufferedReadergetBufferedReader(String nombreFichero)
get Buffered Reader
FileReader lector;
lector = new FileReader(nombreFichero);
BufferedReader bufferedReader;
bufferedReader = new BufferedReader(lector);
return bufferedReader;
BufferedReadergetBufferedReader(String szFile)
Returns a buffered reader.
BufferedReader br;
if (szFile.endsWith(".gz")) {
    try {
        br = new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(szFile))));
    } catch (IOException ioex) {
        System.out.println("IOException thrown for file " + szFile);
        throw ioex;
} else {
    br = new BufferedReader(new FileReader(szFile));
return br;
BufferedReadergetBufferedReaderAsResource(Class clazz, String fileName)
get Buffered Reader As Resource
return new BufferedReader(getInputStreamReaderAsResource(clazz, fileName));
BufferedReadergetBufferedReaderFromFileName(File file)
Open a file handle from a gzip-compressed or uncompressed file
FileInputStream fin = new FileInputStream(file);
BufferedReader br;
if (file.getName().endsWith(".gz"))
    br = new BufferedReader(new InputStreamReader(new GZIPInputStream(fin)));
else
    br = new BufferedReader(new InputStreamReader(new DataInputStream(fin)));
return br;