List of utility methods to do FileReader Read
String | load(String filename) load try { FileReader f = new FileReader(filename); char[] buf = new char[10 * 1024]; StringBuffer s = new StringBuffer(); int hasread = f.read(buf); while (hasread != -1) { s.append(buf, 0, hasread); hasread = f.read(buf); ... |
T | load(String fileName, Class load File file = new File(fileName); Gson gson = new Gson(); try (FileReader rdr = new FileReader(file)) { return gson.fromJson(rdr, klass); |
Hashtable | loadIndex(File root_) Loads an index (Hashtable) from a file. return loadIndex(root_, "index"); |
JsonObject | loadJSON(File file) load JSON return loadJSON(new FileReader(file)); |
ArrayList | loadKeggInteractions(String species, String location) load Kegg Interactions ArrayList<String> kegg = new ArrayList<String>(); String fileName = location + species + "_kegg_edges.txt"; try { FileReader fr = new FileReader(fileName); LineNumberReader lnr = new LineNumberReader(fr); String s = null; while ((s = lnr.readLine()) != null) { s = s.trim(); ... |
String | readFile(File f) read File final char[] buffer = new char[8192]; int bufferLength = 0; StringBuffer textBuffer = new StringBuffer(); Reader reader = new FileReader(f); while (bufferLength != -1) { bufferLength = reader.read(buffer); if (bufferLength > 0) { textBuffer.append(new String(buffer, 0, bufferLength)); ... |
String | readFile(File f) read File long n = f.length(); char[] cbuf = new char[(int) n]; FileReader fr = new FileReader(f); fr.read(cbuf); fr.close(); return (new String(cbuf)); |
String | readFile(File file) read File Reader in = new FileReader(file); StringBuilder buffer = new StringBuilder(); int i; while ((i = in.read()) != -1) buffer.append((char) i); in.close(); return buffer.toString(); |
String | readFile(File file) Deserializes the given file and returns its content as a string Reader reader; try { reader = new FileReader(file.getAbsolutePath()); } catch (FileNotFoundException e) { throw new Exception("Couldn't create reader", e); String text = ""; try { ... |
String | readFile(File file) read File Reader reader = new FileReader(file); try { StringBuilder sb = new StringBuilder(); char[] buffer = new char[512]; int n; while ((n = reader.read(buffer)) != -1) sb.append(buffer, 0, n); return sb.toString(); ... |