List of utility methods to do FileOutputStream Create
void | writeFile(String directoryPath, String filename, byte[] bytes) Write a file containing the data in an array of bytes. try { FileOutputStream os = new FileOutputStream(new File(directoryPath, filename)); BufferedOutputStream bos = new BufferedOutputStream(os); bos.write(bytes, 0, bytes.length); bos.flush(); os.flush(); bos.close(); os.close(); ... |
void | writeFile(String f, String s) write File OutputStreamWriter out = null; try { out = new OutputStreamWriter(new FileOutputStream(f), "UTF-8"); out.write(s); } finally { try { if (out != null) out.close(); ... |
void | writeFile(String file, byte[]... data) write File try (FileOutputStream fos = new FileOutputStream(file)) { for (byte[] d : data) { fos.write(d); } catch (IOException ex) { |
void | writeFile(String file, byte[]... data) write File try (FileOutputStream fos = new FileOutputStream(file)) { for (byte[] d : data) { fos.write(d); } catch (IOException ex) { |
OutputStream | writeFile(String fileName) Writes the file corresponding to the passed file name. if (fileName == null) throw new IllegalArgumentException("No file name specified."); File f = new File(fileName); FileOutputStream out = null; try { out = new FileOutputStream(f); return new BufferedOutputStream(out); } catch (Exception e) { ... |
void | writeFile(String fileOutput, byte[] data) write File OutputStream outputStream = new FileOutputStream(fileOutput); try { outputStream.write(data); } finally { outputStream.close(); |
void | writeFile(String filePath, byte[] bytes) Writes given bytes to the file try (FileOutputStream fos = new FileOutputStream(filePath)) { fos.write(bytes); } catch (IOException ex) { System.out.println("Error writing file: " + ex.toString()); |
void | writeFile(String filePath, Object obj) write File FileOutputStream fop = null; File file; String content = obj.toString(); try { file = new File(filePath); fop = new FileOutputStream(file); if (!file.exists()) { file.createNewFile(); ... |
void | writeFile(String filePathName, Object obj) write File ObjectOutputStream oout = null; File file = new File(filePathName); try { if (!file.exists()) { file.createNewFile(); oout = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file))); oout.writeObject(obj); ... |
void | writeFile(String p_filename, String p_buffer) Write a TEXT file FileOutputStream os = null; try { os = new FileOutputStream(p_filename); if (p_buffer != null) { os.write(p_buffer.getBytes()); os.close(); os = null; ... |