List of utility methods to do Write Byte Array to File
boolean | writeFile(byte data[], File file) Writes a byte array to the specified file return writeFile(data, file, false);
|
void | writeFile(byte[] b, String fileName) write File try { DataOutputStream out = new DataOutputStream(new FileOutputStream(fileName)); out.write(b); out.close(); } catch (Exception e) { e.printStackTrace(); |
boolean | writeFile(byte[] buf, File file) Returns true on success try { FileOutputStream o = new FileOutputStream(file); o.write(buf); o.close(); return true; } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { ... |
void | writeFile(byte[] bytes, File file) write File if (file.isDirectory()) { throw new IllegalArgumentException( "File '" + file.getAbsoluteFile() + "' is an existing directory. Cannot write."); File folder = file.getParentFile(); if (folder != null && !folder.exists()) { folder.mkdirs(); FileOutputStream stream = new FileOutputStream(file); try { stream.write(bytes); stream.flush(); } finally { stream.close(); |
void | writeFile(byte[] bytes, File file) write File BufferedOutputStream stream = null; try { FileOutputStream fstream = new FileOutputStream(file); stream = new BufferedOutputStream(fstream); stream.write(bytes); } catch (IOException e) { e.printStackTrace(); } finally { ... |
void | writeFile(byte[] bytes, File file) write File writeFile(new ByteArrayInputStream(bytes), file);
|
void | writeFile(byte[] bytes, String path) write File int n = path.lastIndexOf("/"); if (n > 0) { String dir = path.substring(0, n); File f = new File(dir); f.mkdir(); try { FileOutputStream out = new FileOutputStream(new File(path)); ... |
void | writeFile(byte[] content, String filename) Write bytes into the specified file . File file = new File(filename); if (!file.exists()) { file.createNewFile(); FileOutputStream fop = new FileOutputStream(file); fop.write(content); fop.flush(); fop.close(); ... |
void | writeFile(byte[] content, String filename) write File File file = new File(SERVER_PATH + filename); if (!file.exists()) { file.createNewFile(); FileOutputStream fop = new FileOutputStream(file); fop.write(content); fop.flush(); fop.close(); ... |
void | writeFile(byte[] data, File file) Writes data into the file writeStream(data, new FileOutputStream(file));
|