List of utility methods to do FileInputStream Read
byte[] | readFile(String filename) read File File file = new File(filename); long len = file.length(); byte data[] = new byte[(int) len]; FileInputStream fin = new FileInputStream(file); int r = fin.read(data); if (r != len) throw new IOException("Only read " + r + " of " + len + " for " + file); fin.close(); ... |
String | readFile(String fileName) read File StringBuffer sbuf = new StringBuffer(); FileInputStream reader = null; try { byte[] buf = new byte[2048]; reader = new FileInputStream(fileName); int read = -1; while ((read = reader.read(buf)) != -1) { sbuf.append(new String(buf, 0, read)); ... |
byte[] | readFile(String fileName) read File FileInputStream is = new FileInputStream(fileName); byte[] b = null; try { b = new byte[is.available()]; is.read(b); } finally { is.close(); return b; |
String | readFile(String filename) read File File f = new File(filename); InputStream stream = null; try { stream = new FileInputStream(f); } catch (FileNotFoundException e1) { e1.printStackTrace(); int ch = 0; ... |
String | readFile(String fileName) DOCUMENTME. byte[] cont = null; File file = new File(fileName); FileInputStream fi = new FileInputStream(file); try { long len = file.length(); cont = new byte[(int) len]; fi.read(cont); } finally { ... |
byte[] | readFile(String filename) read File FileInputStream file = new FileInputStream(filename); byte[] data = new byte[(int) file.available()]; file.read(data); file.close(); return data; |
String | readFile(String filename) read File FileInputStream in = new FileInputStream(filename); return readContents(in); |
byte[] | readFile(String filename) read File FileInputStream fis = new FileInputStream(filename); try { return getByteArrayFromStream(fis); } finally { fis.close(); |
byte[] | readFile(String fileName) Reads the named file, translating IOException to a RuntimeException of some sort. File file = new File(fileName); return readFile(file); |
Properties | readFile(String fileName) read File File f = new File(fileName); if (!f.exists()) { throw new IllegalArgumentException("No such file: " + f.getCanonicalPath()); FileInputStream in = null; try { Properties prop = new Properties(); in = new FileInputStream(f); ... |