List of utility methods to do InputStream Create
InputStream | getInputStream(String path) get Input Stream InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(path); if (null == is) { throw new FileNotFoundException(path + " cannot be opened because it does not exist"); return is; |
InputStream | getInputStream(String path) get Input Stream try { return new FileInputStream(path); } catch (FileNotFoundException e) { e.printStackTrace(); return null; |
InputStream | getInputStream(String path) get Input Stream return new FileInputStream(path); |
InputStream | getInputStream(String sPath) Creates an input stream from the path @sPath. try { InputStream is = new FileInputStream(new File(sPath)); return is; } catch (FileNotFoundException ex) { return null; |
InputStream | getInputStream(String str) Returns an InputStream given a String str byte[] b = str.getBytes(); ByteArrayInputStream iStream = new ByteArrayInputStream(b); return iStream; |
InputStream | getInputStream(String text) get Input Stream InputStream inputStream = new ByteArrayInputStream(text.getBytes("utf-8")); return inputStream; |
InputStream | getInputStream(String thePath) get Input Stream try { return new FileInputStream(thePath); } catch (FileNotFoundException ex) { System.err.println("### ERROR @ Util.getInputStream / couldn t create inputstream " + ex); return null; |
InputStream | getInputStream(String url) return input stream from specified url InputStream is = null; if (url != null) { if (url.indexOf(File.separator) != -1) { byte[] infoArray = readFile(url); if (infoArray != null) { is = new ByteArrayInputStream(infoArray); } else { ... |
InputStream | getInputStream(String xmlStr) get InputStream data return new ByteArrayInputStream(xmlStr.getBytes()); |
InputStream | getInputStream(String... subpaths) get Input Stream String path = join(File.separator, subpaths); File file = new File(path); return new FileInputStream(file); |