List of utility methods to do FileOutputStream Write
void | saveToBinaryFile(File dest, byte[] data) save To Binary File FileOutputStream out = null; try { out = new FileOutputStream(dest); out.write(data); } finally { close(out); |
void | saveToDisc(final InputStream fileInputStream, final String fileUploadPath) save To Disc final OutputStream out = new FileOutputStream(new File(fileUploadPath)); int read = 0; byte[] bytes = new byte[BUFFER_SIZE]; while ((read = fileInputStream.read(bytes)) != -1) { out.write(bytes, 0, read); out.flush(); out.close(); ... |
void | saveToDisk(InputStream is, String filename) save primary conetent to local FileOutputStream fos = new FileOutputStream(filename); byte[] buf = new byte[1024]; int len = 0; while ((len = is.read(buf)) > 0) { fos.write(buf, 0, len); fos.flush(); fos.close(); ... |
void | saveToDisk(String contents, String filename) save To Disk FileOutputStream fos = null; try { fos = new FileOutputStream(filename); fos.write(contents.getBytes(DEFAULT_CHARSET)); fos.flush(); } finally { if (fos != null) fos.close(); ... |
void | saveToEml(Message mail, File emlFile) save To Eml OutputStream os = null; try { os = new FileOutputStream(emlFile); mail.writeTo(os); } finally { if (os != null) { os.close(); |
boolean | saveToFile(byte[] data, String filename) save To File OutputStream os = null; ByteArrayInputStream bin = null; try { if (data != null) { bin = new ByteArrayInputStream(data); os = new FileOutputStream(filename); byte[] bytes = new byte[1024]; int c; ... |
void | saveToFile(File file, byte[] buffer) Saves an array of bytes to a file in the file system. FileOutputStream out = new FileOutputStream(file); try { out.write(buffer); } finally { out.close(); |
void | saveToFile(final String file, final byte[] data, final boolean overwrite) save byte array into a file assertNotNull(file, "file"); assertNotNull(data, "data"); final File f = new File(file); if (f.exists() && !overwrite) { throw new IllegalArgumentException("cannot overwrite file " + file); FileOutputStream fos = null; try { ... |
void | saveToFile(final String text, final File file) save To File final FileOutputStream os = new FileOutputStream(file); try { os.write(text.getBytes(ENCODING)); os.flush(); } finally { os.close(); |
void | saveToFile(InputStream in, File dst) saves content of src into dst if (dst.exists()) dst.delete(); dst.createNewFile(); OutputStream out = new FileOutputStream(dst); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); ... |