List of utility methods to do File to Reader
BufferedReader | newReader(File file) new Reader return new BufferedReader(new FileReader(file)); |
Reader | newReader(File file, String charset) new Reader return new InputStreamReader(new FileInputStream(file), charset); |
BufferedReader | newReader(File file, String encoding) new Reader if (encoding == null || encoding.length() <= 0) { return new BufferedReader(new InputStreamReader(new FileInputStream(file))); return new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding)); |
BufferedReader | newReader(File pathname) new Reader InputStream is = null; try { is = new FileInputStream(pathname); return new BufferedReader(new InputStreamReader(is, "UTF-8")); } catch (IOException e) { close(is); return null; ... |
BufferedReader | newReader(String value) new Reader return (new BufferedReader(new StringReader(value))); |
Reader | openReader(File file) Opens a Reader on a file. checkNull(file); try { return new FileReader(file); } catch (FileNotFoundException e) { return null; |
InputStreamReader | openReader(final String file, String charset) open Reader return new InputStreamReader(open(file), charset); |
BufferedReader | openReader(String dir, String filename, String encoding) open Reader File file = new File(dir + filename); return new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding), 4 * 1024); |
BufferedReader | openReader(String file) Create a newBufferedReader try { File f = new File(file); if (f.exists() == false) { return null; return new BufferedReader(new FileReader(file)); } catch (Exception e) { e.printStackTrace(); ... |
FileReader | openReader(String filePath) open Reader return openReader(new File(filePath)); |