Here you can find the source of writeFile(String filePath, byte[] bytes)
Parameter | Description |
---|---|
filePath | a parameter |
bytes | a parameter |
public static void writeFile(String filePath, byte[] bytes)
//package com.java2s; //License from project: Open Source License import java.io.FileOutputStream; import java.io.IOException; public class Main { /**//from ww w.j a v a 2 s . c o m * Writes given bytes to the file * * @param filePath * @param bytes */ public static void writeFile(String filePath, byte[] bytes) { try (FileOutputStream fos = new FileOutputStream(filePath)) { fos.write(bytes); } catch (IOException ex) { System.out.println("Error writing file: " + ex.toString()); } } }