List of utility methods to do BufferedReader Create
BufferedReader | getBufferedReaderFromInputStream(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; |
BufferedReader | getBufferedReaderFromInputStreamReader(InputStreamReader isReader) get Buffered Reader From Input Stream Reader return new BufferedReader(isReader); |
BufferedReader | getBufferedReaderMaybeGZ(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); ... |
BufferedReader | getReader() Method getReader returns the reader of this ConsoleUtils object. if (bufferedReader == null) { bufferedReader = new BufferedReader(new InputStreamReader(System.in)); return bufferedReader; |
Reader | getReader(File file) get Reader return new BufferedReader(new InputStreamReader(new FileInputStream(file))); |
BufferedReader | getReader(File file) get Reader return new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); |
BufferedReader | getReader(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)); |
BufferedReader | getReader(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; ... |
BufferedReader | getReader(File inFile) Gets the reader. FileInputStream rfis = new FileInputStream(inFile); InputStreamReader risr = new InputStreamReader(rfis, "UTF-8"); BufferedReader rbr = new BufferedReader(risr); return rbr; |
BufferedReader | getReader(File queryFile) get Reader BufferedReader br = null; br = new BufferedReader(new FileReader(queryFile)); return br; |