List of utility methods to do Write Byte Array to File
File | writeFile(File file, byte[] data) Write a byte array to a given file. FileOutputStream os = new FileOutputStream(file); os.write(data); os.close(); return file; |
boolean | writeFile(File file, byte[] data) write File try { FileOutputStream fos = new FileOutputStream(file); fos.write(data, 0, data.length); fos.flush(); fos.close(); return true; } catch (Exception e) { System.out.println("writeFile failed with " + e); ... |
void | writeFile(File file, byte[] data) write File OutputStream out = new FileOutputStream(file); try { out.write(data); out.flush(); out.close(); } finally { try { out.close(); ... |
void | writeFile(File file, byte[] data) Creates and writes a binary file file.createNewFile(); file.setWritable(true); RandomAccessFile raf = new RandomAccessFile(file, "rw"); try { raf.setLength(data.length); raf.seek(0); raf.write(data); } finally { ... |
void | writeFile(File file, byte[] data) write File FileOutputStream os = new FileOutputStream(file); try { os.write(data); } finally { os.close(); |
void | writeFile(File file, byte[] data) write File ByteArrayInputStream bais = new ByteArrayInputStream(data); FileOutputStream fos = new FileOutputStream(file); BufferedOutputStream bos = new BufferedOutputStream(fos); byte[] buffer = new byte[1024]; int br; while ((br = bais.read(buffer)) > 0) { bos.write(buffer, 0, br); bos.close(); bais.close(); |
void | writeFile(File file, byte[] data) write File file.mkdirs(); try (FileOutputStream fos = new FileOutputStream(file)) { fos.write(data); |
void | writeFile(File file, byte[]... data) Takes a byte array, or list of byte arrays, and writes them into a file. if (data == null) return; BufferedOutputStream out = null; try { out = new BufferedOutputStream(new FileOutputStream(file)); for (byte[] d : data) out.write(d); } catch (Exception exception) { ... |
boolean | writeFile(final File file, byte[] data) write File try { OutputStream output = null; try { output = new BufferedOutputStream(new FileOutputStream(file)); output.write(data); output.flush(); return true; } finally { ... |
void | writeFile(String filename, byte data[]) write File FileOutputStream fout = new FileOutputStream(filename);
fout.write(data);
fout.close();
|