byte-Array to File


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /**
  2.   * Writes an byte array into a file.
  3.   * @param data Data that should be written into a file.
  4.   * @param filename The file, that should be used.
  5.   * @throws IOException
  6.   */
  7. public static void writeByte2File(byte[] data, String filename) throws IOException {
  8. OutputStream out = new FileOutputStream(filename);
  9. out.write(data);
  10. out.close();
  11. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.