List of utility methods to do FileOutputStream Write
void | saveToFile(InputStream in, String fileName) save To File FileOutputStream fos = null; BufferedInputStream bis = null; int BUFFER_SIZE = 1024; byte[] buf = new byte[BUFFER_SIZE]; int size = 0; bis = new BufferedInputStream(in); fos = new FileOutputStream(fileName); while ((size = bis.read(buf)) != -1) ... |
void | saveToFile(InputStream stream, File file) save To File FileOutputStream fos = new FileOutputStream(file); byte[] buf = new byte[BUF_SIZE]; int len; while ((len = stream.read(buf)) != -1) { fos.write(buf, 0, len); fos.close(); |
String | saveToFile(String baseName, String extension, byte[] content) Saves byte[] to new file. String result; File output = determineFilename(baseName, extension); FileOutputStream target = null; try { target = new FileOutputStream(output); target.write(content); result = output.getAbsolutePath(); } catch (Exception e) { ... |
void | saveToFile(String data, File file) Save to file. FileOutputStream fos = null; try { fos = new FileOutputStream(file); fos.write(data.getBytes()); } finally { if (fos != null) fos.close(); |
void | saveToFile(String data, File file) save To File FileOutputStream fos = null; try { fos = new FileOutputStream(file); fos.write(data.getBytes()); } finally { if (fos != null) fos.close(); |
File | saveToFile(String fileName, String fileCode, File dir, String fileExtention) save To File try { if (!dir.exists()) { dir.mkdirs(); } catch (Exception e) { e.printStackTrace(); FileOutputStream fos = null; ... |
void | saveToFile(String filePath, InputStream in) save To File FileOutputStream fos = null; BufferedInputStream bis = null; try { int BUFFER_SIZE = 1024; byte[] buf = new byte[BUFFER_SIZE]; int size = 0; bis = new BufferedInputStream(in); fos = new FileOutputStream(filePath); ... |
void | saveToTextFile(String filename, byte[] text) save To Text File FileOutputStream out = new FileOutputStream(filename + ".ctron"); byte[] buffer = text; out.write(buffer, 0, buffer.length); |
void | SaveToZipSB(File file, String ZippedFile, StringBuilder sb) Save To Zip SB try { final ZipOutputStream out = new ZipOutputStream(new FileOutputStream(file)); ZipEntry e = new ZipEntry(ZippedFile); out.putNextEntry(e); byte[] data = sb.toString().getBytes(); out.write(data, 0, data.length); out.closeEntry(); out.close(); ... |
void | saveZip(String fileName, Map save Zip try { FileOutputStream fos = new FileOutputStream(fileName); JarOutputStream jos = new JarOutputStream(fos); byte buf[] = new byte[256]; if (dataMap != null) { Set<Entry<String, InputStream>> entrySet = dataMap.entrySet(); int len = -1; for (Entry<String, InputStream> entry : entrySet) { ... |