List of utility methods to do FileOutputStream Write
void | saveBytes(byte[] bytes, File file) Saves binary data to a file. OutputStream out = new FileOutputStream(file); try { out.write(bytes, 0, bytes.length); out.flush(); } finally { out.close(); |
void | saveBytes(File f, byte[] content) save Bytes FileOutputStream os = null; ByteArrayInputStream bais = null; try { os = new FileOutputStream(f); bais = new ByteArrayInputStream(content); byte[] buf = new byte[BUF_SIZE]; while (true) { int rc = bais.read(buf); ... |
void | saveBytes(File file, byte[] bytes) save Bytes FileOutputStream outputs = null; if (bytes == null) throw new NullPointerException("Cannot save null as file."); try { outputs = new FileOutputStream(file); outputs.write(bytes); outputs.close(); } catch (IOException t) { ... |
void | saveBytes(String filename, byte[] byteData) save Bytes try { createPath(filename); FileOutputStream fileOutputStream = new FileOutputStream(filename); fileOutputStream.write(byteData); fileOutputStream.close(); } catch (Exception e) { System.err.println("### ERROR @ Util / problem writing data. " + e.toString()); |
void | saveBytes(String filename, byte[] bytes) save Bytes try { BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(new File(filename))); out.write(bytes); out.close(); } catch (Exception exception) { exception.printStackTrace(); |
void | saveBytes(String filename, byte[] data) Saves data to the file specified by filename .
FileOutputStream fo = null; try { fo = new FileOutputStream(filename); fo.write(data); } finally { closeStream(fo); |
void | saveBytes(String filename, byte[] data) ( begin auto-generated from saveBytes.xml ) Opposite of loadBytes(), will write an entire array of bytes to a file. saveBytes(saveFile(filename), data); |
void | saveBytesToFile(byte[] bytes, File file) save Bytes To File if (file.exists()) { file.delete(); if (bytes == null || bytes.length == 0) { return; try { file.createNewFile(); ... |
void | saveBytesToFile(byte[] bytes, File file) Used for testing only if we need to open the PDF itself final FileOutputStream outputStream = new FileOutputStream(file); outputStream.write(bytes); outputStream.close(); System.out.println("PDF dumped to " + file.getAbsolutePath() + " by the following calls:"); dumpCurrentStackTrace(System.out); |
void | saveBytesToFile(byte[] data, File file) save to file if (data == null) { return; FileOutputStream fos = null; BufferedOutputStream bos = null; try { fos = new FileOutputStream(file); bos = new BufferedOutputStream(fos); ... |