List of utility methods to do FileOutputStream Write
void | save(byte[] bytes, File path) save if (bytes != null) { FileOutputStream fos = new FileOutputStream(path); fos.write(bytes); fos.close(); |
void | save(byte[] data, String path) save File f = new File(path); File p = f.getParentFile(); if ((p != null) && (!p.isDirectory())) { p.mkdirs(); FileOutputStream fout = new FileOutputStream(f); fout.write(data); fout.close(); ... |
void | save(File file, byte[] bytes) Saves a byte array to a file. OutputStream os = new FileOutputStream(file); try { os = new BufferedOutputStream(os); for (int i = 0; i < bytes.length; i += 2048) { int len = Math.min(bytes.length - i, 2048); os.write(bytes, i, len); } finally { ... |
void | save(File file, byte[] content) save FileOutputStream out = new FileOutputStream(file);
save(out, content);
out.close();
|
void | save(File file, byte[] content) save FileOutputStream out = new FileOutputStream(file); try { out.write(content); } finally { out.close(); |
void | save(File file, final byte[] encoded) save file = expandFilepath(file); File parent = file.getParentFile(); if (parent != null && parent.exists() == false) { parent.mkdirs(); FileOutputStream out = new FileOutputStream(file); try { out.write(encoded); ... |
void | save(final InputStream in, final File file) Saves the contents of an InputStream in a file. file.getParentFile().mkdirs(); FileOutputStream out = null; try { out = new FileOutputStream(file); final byte[] buffer = new byte[16 * 1024]; int read; while ((read = in.read(buffer)) > 0) { out.write(buffer, 0, read); ... |
void | save(InputStream in, File f) save FileOutputStream out = new FileOutputStream(f); try { byte[] buffer = new byte[4 * 1024]; int len = 0; while ((len = in.read(buffer)) != -1) { out.write(buffer, 0, len); } finally { ... |
void | save(String content, String fileName) save File file = new File(fileName); OutputStream out = new FileOutputStream(file); out.write(content.getBytes("UTF-8")); out.flush(); out.close(); |
void | save(String data, String encoding, String file) save FileOutputStream os = new FileOutputStream(file); byte[] buf = data.getBytes(encoding); os.write(buf); os.close(); |