List of utility methods to do FileOutputStream Create
OutputStream | getOutputStream(File file) get Output Stream return getOutputStream(file, false);
|
OutputStream | getOutputStream(File file) get Output Stream assert file != null; OutputStream out = null; try { out = new FileOutputStream(file); } catch (FileNotFoundException e) { System.err.println("Can't find file " + file); e.printStackTrace(); return out; |
OutputStream | getOutputStream(File file, String filePath) get Output Stream try { return new FileOutputStream(filePath + "/" + file.getName()); } catch (FileNotFoundException e) { e.printStackTrace(); return null; |
FileOutputStream | getOutputStream(final File file) get Output Stream try { return new FileOutputStream(file); } catch (FileNotFoundException e) { return null; |
OutputStream | getOutputStream(final File file) Gets the output stream from a File object. return getOutputStream(file, false);
|
OutputStream | getOutputStream(final Object obj, final boolean append) Turn an object into an OutputStream if possible. OutputStream stream = null; if (obj instanceof OutputStream) { stream = (OutputStream) obj; } else if (obj instanceof File) { File file = (File) obj; File parent = file.getAbsoluteFile().getParentFile(); if (!parent.exists()) { if (!parent.mkdirs()) { ... |
DataOutputStream | getOutputStream(String file) Return a buffered output stream stream for file. return getOutputStream(new File(file)); |
OutputStream | getOutputStream(String filename) Gets an output stream OutputStream os = null; try { File f = new File(filename); os = new FileOutputStream(f); } catch (Exception e) { try { os.close(); } catch (Exception ex) { ... |
BufferedOutputStream | getOutputStream(String fileName) get Output Stream return getOutputStream(new File(fileName)); |
OutputStream | getOutputStream(String filename, Map Returns the OutputStream contained in the map , if present, or creates a new OutputStream attached to the specified file. if (map != null && map.containsKey(filename)) { return map.get(filename); } else { return new FileOutputStream(filename); |