List of utility methods to do Write Byte Array to File
void | writeFile(byte[] data, File outFile) Writes byte array to file. FileOutputStream fos = null; try { if (outFile.getParentFile() != null) { outFile.getParentFile().mkdirs(); fos = new FileOutputStream(outFile); fos.write(data); } finally { ... |
void | writeFile(byte[] data, String fileName) write File OutputStream out = new FileOutputStream(fileName);
out.write(data);
out.close();
|
void | writeFile(byte[] data, String filePath) write File FileOutputStream fos = new FileOutputStream(new File(filePath)); fos.write(data); fos.close(); |
String | writeFile(byte[] data, String path, boolean overwrite) Writes a file to the given path, appending digits to the end of the file name until it is unique. OutputStream os = null; try { if (data == null) throw new IOException("Data is null"); String path2 = path; File f = new File(path2); int index = 0; while (f.exists() && !overwrite) { ... |
void | writeFile(byte[] fileData, String path) Writes the given byte array to a file. File fileToWrite = new File(path); if (!fileToWrite.exists()) { File pathToFile = new File(fileToWrite.getParent()); pathToFile.mkdirs(); fileToWrite.createNewFile(); FileOutputStream outStream = null; try { ... |
void | writeFile(byte[] outputBytes, String outputFile) write File OutputStream os = new FileOutputStream(outputFile);
os.write(outputBytes);
os.flush();
os.close();
|
void | writeFile(File f, byte[] data) write File try { RandomAccessFile raf = new RandomAccessFile(f, "rw"); try { raf.write(data); } finally { raf.close(); } catch (IOException e) { ... |
void | writeFile(File file, byte[] b) write File FileOutputStream fos = new FileOutputStream(file);
fos.write(b);
fos.close();
|
void | writeFile(File file, byte[] content) write File FileOutputStream outputStream = new FileOutputStream(file, false); try { for (int i = 0; i < content.length; i++) { outputStream.write(content[i]); } finally { outputStream.close(); |
void | writeFile(File file, byte[] context, boolean append) write File FileOutputStream fos = null; if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } else if (append) { fos = new FileOutputStream(file, append); if (fos == null) { fos = new FileOutputStream(file); ... |