List of utility methods to do BufferedReader Create
Reader | getBufferedReader(Reader r) Wraps the specified reader in a buffered reader. if (r instanceof BufferedReader || r instanceof StringReader) return r; return new BufferedReader(r); |
BufferedReader | getBufferedReader(Reader rd) Get BufferedReader .
BufferedReader br = null; if (br instanceof java.io.BufferedReader) { br = (BufferedReader) rd; } else { br = new BufferedReader(rd); return br; |
BufferedReader | getBufferedReader(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)); ... |
BufferedReader | getBufferedReader(String file) get Buffered Reader BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(file)); } catch (Exception e) { return reader; |
BufferedReader | getBufferedReader(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); ... |
BufferedReader | getBufferedReader(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)); |
BufferedReader | getBufferedReader(String nombreFichero) get Buffered Reader FileReader lector; lector = new FileReader(nombreFichero); BufferedReader bufferedReader; bufferedReader = new BufferedReader(lector); return bufferedReader; |
BufferedReader | getBufferedReader(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; |
BufferedReader | getBufferedReaderAsResource(Class> clazz, String fileName) get Buffered Reader As Resource return new BufferedReader(getInputStreamReaderAsResource(clazz, fileName)); |
BufferedReader | getBufferedReaderFromFileName(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; |