Here you can find the source of writeBytesToFile(byte[] byteContent, String fileName)
Parameter | Description |
---|---|
byteContent | the byte content |
fileName | the file name |
Parameter | Description |
---|---|
Exception | the exception |
public static void writeBytesToFile(byte[] byteContent, String fileName) throws Exception
//package com.java2s; import java.io.File; import java.io.FileOutputStream; public class Main { /**// www .ja v a2 s . c o m * ***************************************** * Output Bytes to file * ******************************************. * * @param byteContent the byte content * @param fileName the file name * @throws Exception the exception */ public static void writeBytesToFile(byte[] byteContent, String fileName) throws Exception { File kekFile = new File("c:\\temp\\" + fileName); FileOutputStream f = new FileOutputStream(kekFile); f.write(byteContent); f.close(); } }