Here you can find the source of writeBytesToFile(final byte[] data, String filename)
Parameter | Description |
---|---|
data | Data to write |
filename | Filename to write data to |
Parameter | Description |
---|---|
IOException | on Error |
public static void writeBytesToFile(final byte[] data, String filename) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.FileOutputStream; import java.io.IOException; public class Main { /**//ww w .j a v a2 s.c o m * Write byte array to file * * @param data Data to write * @param filename Filename to write data to * @throws IOException on Error */ public static void writeBytesToFile(final byte[] data, String filename) throws IOException { FileOutputStream fos = new FileOutputStream(filename); fos.write(data); fos.close(); } }