List of utility methods to do InputStreamReader Read
List | readFile(String file) read File return readFile(new InputStreamReader(new FileInputStream(file), "UTF-8")); |
String | readFile(String file) read File return readFile(file, null);
|
String | readFile(String file, String charset) read File FileInputStream in = new FileInputStream(file); InputStreamReader r1 = new InputStreamReader(in, charset); BufferedReader r2 = new BufferedReader(r1); StringBuffer sb = new StringBuffer(); while (true) { String s = r2.readLine(); if (s == null) break; ... |
String | readFile(String file, String lineBreak) read File File f = new File(file); return readFile(f, lineBreak); |
List | readFile(String fileFullPath) read File List<String> retList = new ArrayList<String>(); try { File inputFlie = new File(fileFullPath); InputStreamReader reader = new InputStreamReader(new FileInputStream(inputFlie)); BufferedReader br = new BufferedReader(reader); String line = ""; line = br.readLine(); while (line != null) { ... |
String | readFile(String fileName) Reads contents of file fully and returns as string. FileInputStream in = null; try { in = new FileInputStream(fileName); return read(in); } catch (Exception e) { throw new RuntimeException(e); } finally { close(in); ... |
String | readFile(String filename) read File File in = new File(filename); try { Reader fr = new InputStreamReader(new FileInputStream(in), "UTF-8"); char[] cbuf = new char[(int) in.length()]; try { fr.read(cbuf); return String.valueOf(cbuf); } catch (Exception e) { ... |
char[] | readFile(String fileName) read File return readFile(fileName, null);
|
String | readFile(String filename) Reads the given filename into a string. BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename))); StringBuffer result = new StringBuffer(); String tmp = reader.readLine(); while (tmp != null) { result.append(tmp + "\n"); tmp = reader.readLine(); reader.close(); ... |
String | readFile(String filename) read File java.io.BufferedReader br = new java.io.BufferedReader(new java.io.InputStreamReader( Thread.currentThread().getContextClassLoader().getResourceAsStream(filename))); StringBuffer sb = new StringBuffer(); try { String newline = System.getProperty("line.separator"); String tmp = null; while ((tmp = br.readLine()) != null) { sb.append(tmp); ... |