List of utility methods to do BufferedReader Create
BufferedReader | getReader(String filename) get Reader return getReader(new File(filename)); |
Reader | getReader(String filename) getReader if (filename == "") { return null; if (filename.equals("-")) { return new BufferedReader(new InputStreamReader(System.in)); File inputFile = new File(filename); if (!inputFile.exists()) { ... |
BufferedReader | getReader(String filename) get Reader return getReader(filename, "UTF-8"); |
BufferedReader | getReader(String filePath, String charset) get Reader return new BufferedReader(new InputStreamReader(new FileInputStream(filePath), charset)); |
BufferedReader | getReader(String path) get Reader if (path.endsWith(".gz")) { return new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(path)))); return new BufferedReader(new FileReader(path)); |
BufferedReader | getReader(String Path) get Reader File file = new File(Path); file.createNewFile(); return new BufferedReader(new FileReader(file)); |
BufferedReader | getReader(String path, String charEncoding) get Reader return getReader(new File(path), charEncoding); |
BufferedReader | getReader(String path, String charEncoding) get Reader InputStream is = getInputStream(path); return new BufferedReader(new InputStreamReader(is, charEncoding)); |
String | getReaderAsString(Reader reader) get Reader As String StringWriter sw = new StringWriter(); BufferedReader in = new BufferedReader(reader); char[] buf = new char[8192]; int n; while ((n = in.read(buf)) > 0) { sw.write(buf, 0, n); return sw.toString(); ... |
String | getReaderText(BufferedReader reader) get Reader Text StringBuilder answer = new StringBuilder(); char[] charBuffer = new char[8192]; int nbCharRead ; try { while ((nbCharRead = reader.read(charBuffer)) != -1) { answer.append(charBuffer, 0, nbCharRead); } finally { ... |