List of utility methods to do InputStreamReader Read
String[] | readFile(InputStream location) read File ArrayList<String> readLines = new ArrayList<>(); try (BufferedReader br = new BufferedReader(new InputStreamReader(location))) { String line = br.readLine(); while (line != null) { readLines.add(line); line = br.readLine(); } catch (Exception e) { ... |
void | readFile(InputStream stream, StringBuilder builder) read File BufferedReader br = new BufferedReader(new InputStreamReader(stream)); String s = ""; try { while ((s = br.readLine()) != null) { builder.append(s + "\n"); } catch (IOException e) { e.printStackTrace(); ... |
List | readFile(Reader simpleReader) read File BufferedReader reader = new BufferedReader(simpleReader); List<String> res = new ArrayList(); String line = null; while ((line = reader.readLine()) != null) { res.add(line); reader.close(); return res; ... |
String | readFile(String aFile) Read a file into a string BufferedReader bin = null; StringBuilder sb = new StringBuilder(); try { FileInputStream is = new FileInputStream(aFile); bin = new BufferedReader(new InputStreamReader(is, "UTF-8")); String line = null; while ((line = bin.readLine()) != null) { sb.append(line); ... |
String | readFile(String f) read File InputStreamReader in = null; try { StringBuilder sb = new StringBuilder(); in = new InputStreamReader(new FileInputStream(f), "UTF-8"); int count = 0; char[] buf = new char[1024 * 10]; while ((count = in.read(buf, 0, buf.length)) > -1) sb.append(buf, 0, count); ... |
String[][] | readFile(String f, String delim) read File return readFile(f, delim, 0);
|
String | readFile(String file) read File StringBuffer buffer = new StringBuffer(); try { BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); while (br.ready()) { buffer.append(br.readLine()).append("\n"); br.close(); } catch (FileNotFoundException e) { ... |
String | readFile(String file) Get a String representation of a text file FileInputStream stream = new FileInputStream(file); try { return readFile(stream); } finally { stream.close(); |
String | readFile(String file) read File FileReader rd = null; try { rd = new FileReader(file); } catch (FileNotFoundException e) { e.printStackTrace(); BufferedReader br = new BufferedReader(rd); String text = new String(); ... |
String | readFile(String file) read File StringBuilder sb = new StringBuilder(); LineNumberReader lnr = new LineNumberReader(new InputStreamReader(new FileInputStream(file))); while (true) { String line = lnr.readLine(); if (line == null) break; line = line.trim(); sb.append(line); ... |